Final quick form/ query question (hopefully!)

Maxine1010

Registered User.
Local time
Today, 17:43
Joined
Jun 28, 2002
Messages
25
Thanks to help from members on this forum I've managed to get my listbox query working, however I'm just short of completing my form and was hoping I could get some final bits of help.

I can now use a multiple select listbox to run a query but I also want to add date parameters, etc that are inserted via a form. Due to my limited knowledge of code I don't know how or where to write this into the command button event with the rest of the code.

I'd be grateful if someone could point me in the right direction (sample database attached).

Thanks
 

Attachments

Have you tried searching the forum? I think there is even something about this in the faq....

But i know this is a question that is asked atleast twice every week....

Regards
 
Maxine,

Change this:

Code:
'Create the WHERE string, and strip off the last comma of the IN string
strWhere = " WHERE [WardID] in (" & Left(strIN, Len(strIN) - 1) & ")"

To this:

Code:
'Create the WHERE string, and strip off the last comma of the IN string
strWhere = " WHERE Date Between #" & Me.txtStartDate & "# And " & _
           "                    #" & Me.EndDate & "# And " & _
           "       [WardID] in (" & Left(strIN, Len(strIN) - 1) & ")"

Date is a reserved word though, you should change it.

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom