I am trying to load list boxes from an Access database. I'm looking at 3 tables and for each table I'm loading a list box that has current information and another list box that has expired information based on a date/time field in each table. I'm trying to write a function that will do this instead of writing a procedure for each listbox. I can't get the function to use variables for the listbox. Here is what I'm doing.
[CODE=vb]Private...
User Profile
Collapse
-
Pass pairs of listboxes to a sub
-
haha. Conceded. But youre right, I flipped my quotes around in the first post. I used " ' instead of ' ". But I concede. You are the victor. :)... -
I agree with you when your printing quotes " " to the screen however, I have found that quotes in the query are reversed ' " " ' depending on where they are used. The following are examples that I have been using in my own applications.
...Code:DATAtow.RecordSource = "select * from messages where user =' " & (Mid(from(Index).Caption, 1, 3)) & " ' order by sent desc"
Leave a comment:
-
What's the difference between my post and yours other than you added all of the tables.
my Select [whatever] equals your Select [Event Date], [Due Date], Priority, [Event Status], Category, Contact, [Event Description], [Event Solution]
and my FROM [wherever] equals your FROM contact name
and my WHERE contact = 'form2.namesear ch.text'
Im assuming youre adding the &"" to handle...Leave a comment:
-
I use VB6 and I recently had a similar problem. And I have found that quotes are very important. :) Variable or objects need to been with in single quotes in side of double quotes like " 'variable' " So, give this a try.
SELECT (what you want)
FROM (where you want)
WHERE 'form2.namesear ch.text'
So it should look something like:
RS = "SELECT [whatever] FROM [WHEREVER] WHERE...Leave a comment:
No activity results to display
Show More
Leave a comment: