Combo Box Record Selector AfterUpdate Macro Help (1 Viewer)

jbailey4545

New member
Local time
Yesterday, 20:26
Joined
Jun 1, 2012
Messages
5
I have a form that has a Combo box record selector which works fine. I need to add more to the Where condition of this macro.

Combo1 - Options 1-Facility, 2-Physician (referral_type)

Combo2 - Record selector that works, either shows a list of facilities or list of physicians.
Macro SearchForRecord - Where Condition ="[fac_id] = " & Str(Nz([Screen].[ActiveControl].[Column](0),0))


would like it to be
="[fac_id] = " & Str(Nz([Screen].[ActiveControl].[Column](0),0)) AND [referral_type] = Me!Combo2

Have tried a few different things with no luck.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:26
Joined
Aug 30, 2003
Messages
36,139
I'm not a macro guy but try

="[fac_id] = " & Str(Nz([Screen].[ActiveControl].[Column](0),0)) & " AND [referral_type] = " & Me!Combo2
 

jbailey4545

New member
Local time
Yesterday, 20:26
Joined
Jun 1, 2012
Messages
5
Thanks for the help but that didn't work. Recieved error number 2950 with the Arguments:
-1, , First, ="[fac_id] = " & Str(Nz([Screen].[ActiveControl].[Column](0),0)) & " AND [referral_type] = " & [Me]![Combo2]
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:26
Joined
Aug 30, 2003
Messages
36,139
Sorry, Me would only be valid in VBA. Try with the full form reference:

="[fac_id] = " & Str(Nz([Screen].[ActiveControl].[Column](0),0)) & " AND [referral_type] = " & Forms!FormName.Combo2
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:26
Joined
Aug 30, 2003
Messages
36,139
Happy to help and welcome to the site by the way!
 

Users who are viewing this thread

Top Bottom