Im trying to change a combo box's row source on focus. Dont know why it wont work!

sirantonycartwr

Registered User.
Local time
Today, 01:17
Joined
Dec 10, 2006
Messages
45
ok, ive sorted it out, Access put incorrect SQL code in the vba code!!!!
Ant...
 
if anyone is struggling with this, your code should be similar to this:

Code:
Private Sub SubscriptionType_GotFocus()
If Me.Parent.StakeholderType = "member (corp)" Or Me.Parent.StakeholderType = "customer (corp)" Or Me.Parent.StakeholderType = "external agency (corp)" Then
     Me.SubscriptionType.RowSource = "SELECT tblSubscriptionTypes.SubscriptionTypes FROM tblSubscriptionTypes WHERE tblSubscriptionTypes.SubscriptionTypes Like '*corp*'"
End If
If Me.Parent.StakeholderType = "member (private)" Or Me.Parent.StakeholderType = "customer (private)" Or Me.Parent.StakeholderType = "external agency (private)" Then
     Me.SubscriptionType.RowSource = "SELECT tblSubscriptionTypes.SubscriptionTypes FROM tblSubscriptionTypes WHERE tblSubscriptionTypes.SubscriptionTypes Not Like '*corp*'"
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom