Adding (All)

wbaroudi

New member
Local time
Today, 07:41
Joined
Jan 15, 2015
Messages
8
Hi everyone,

I wonder if someone can help.

I want to put this code in a VBA and I can’t get it to work

i.e.: cmb_Subbie.RowSource = Select qry_Grouped_Subcontractors.Subcontractor from qry_Grouped_Subcontractors union select “(All)” from qry_Grouped_Subcontractors order by qry_Grouped_Subcontractors.Subcontractor;

If I put the above in a combo Row Source it works fine but I have 4 different criterias and I want to change the code based on value selected by the user.

I appreciate your help.
 
just rewrite the rowsource in the afterupdate event of the control where the value changes to whatever it needs to be
 
Thanks CJ_London

I think the problem maybe with the SQL statement quotation marks etc..

If I append Select qry_Grouped_Subcontractors.Subcontractor from qry_Grouped_Subcontractors union select “(All)” from qry_Grouped_Subcontractors order by qry_Grouped_Subcontractors.Subcontractor

between """" then "(All)" breaks the statement and if I change to '(All)' I did not get any values in the drop down.

Cheers
Wessam
 
Hi CJ_London

It was me being an idiot, all working thanks for taking the time to reply.

Cheers
Wessam
 

Users who are viewing this thread

Back
Top Bottom