FINAL working code in case anyone ever wants to refer to this:
Private Sub OK_Click()
On Error GoTo Err_OK_Click
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim t As Integer
Dim i As Integer
Dim strSQL As String
Dim strWhere1 As String
Dim strWhere2...
I figured it out, I changed part of my code as follows
'Create the WHERE string, and strip off the last comma of the IN string
strWhere1 = " WHERE [Tier] in " & _
"(" & Left(strIN1, Len(strIN1) - 1) & ")"
strWhere2 = " AND [Category] in " & _
"(" &...
I am posting up the code I am using currently to try to get both boxes to work. It gives me an error on my " AND [Category] in " & _ ..... Statement
Private Sub OK_Click()
On Error GoTo Err_OK_Click
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim t As Integer...
Thanks Dhookom, but I am not sure I am seeing where your code allows for two separate listbox multi selections to be brought into my query. The datatype for my purpose will always be text from my two separate multiple selection list boxes. I have tried adding "AND" to my strWhere to account...
I have code attached to the OK button on a form which has two list boxes. The first list box is a general category and the second list box is for a more specific category (example: Category 1 = Type of Vehicle, Category 2 = Manufacturer).
Currently I have this all set up for just one category...
Thanks for the input, I actually have been playing around with that line to get the query to work right. Problem is that when I look at the query it is generating with the suggestion you gave me above the criterial field shows "12/31/2007" which gives me an error on my report and an empty...
I have a form I am using to generate a report which will be by company and date. I have a list box set up for the company names and a text box for my date.
I managed to find some code to get the listbox to populate a query with the selections made and then generate a report off that but I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.