Ok, how do you pass the Listbox value from the main form to the Query? If I open up the query, it has a box that pops up and is waiting for the critera that I set. So how can I pass the value that is picked from the listbox on main form to this box in my query? Here is my code so far:
Dim objAccess As Access.Application
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\Mojo.mdb"
objAccess.Visible = True
objAccess.DoCmd.OpenQuery "Query1", acViewNormal
I am using the wrong commands in the following lines, But I think I need something along the lines of this:
objAccess.ListBox.GotFocus
objAccess.ListBox.Value = ListBox


Reply With Quote