I’m currently working on an access07 database that will allow the users to select from 4 different list boxes which will allow them to filter records based on what they select and then display the results in a report.
I have 4 list boxes with the following names:
Lstpayment
lststore
lstkeyword
lstbuyer
This is the part I am stuck on:
When I use the code
strFilter = "[store_name] = '" & Me!lststore & "'"
DoCmd.OpenReport "rptnopic", acViewPreview, , strFilter
it works perfectly for one list box (lststore) and generates the reports correctly. What I am having a problem with is joining additional listboxes to that command so it will filter based on all 4. I’ve tried the following for 2 listboxes and I get a type mismatch error:
strFilter = "[store_name] = '" & Me!lststore & "'" And "[payment_type] = '" & Me!lstpayment & "'"
DoCmd.OpenReport "rptnopic", acViewPreview, , strFilter
I’ve tried various methods of the above and can’t get them to work. Can anyone tell me what I am doing wrong?
I have 4 list boxes with the following names:
Lstpayment
lststore
lstkeyword
lstbuyer
This is the part I am stuck on:
When I use the code
strFilter = "[store_name] = '" & Me!lststore & "'"
DoCmd.OpenReport "rptnopic", acViewPreview, , strFilter
it works perfectly for one list box (lststore) and generates the reports correctly. What I am having a problem with is joining additional listboxes to that command so it will filter based on all 4. I’ve tried the following for 2 listboxes and I get a type mismatch error:
strFilter = "[store_name] = '" & Me!lststore & "'" And "[payment_type] = '" & Me!lstpayment & "'"
DoCmd.OpenReport "rptnopic", acViewPreview, , strFilter
I’ve tried various methods of the above and can’t get them to work. Can anyone tell me what I am doing wrong?