Listbox Call to a form which runs a query

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hello All,

I have a listbox in a form which I want the ability to have
the user double click an item in the listbox and then open another
form. The problem is that the other form runs a query which pulls in
information from 3 other tables. Is there a way that I can pass my id
from the listbox into the query for the form before opening up the
form?

Here is what I have now

DoCmd.OpenForm "Ticket Form", acNormal, , "ALTERNATEKETSUFFIX=" &
myrow, , , acNormal


Thanks for your help in advance,
Nick
 
There a a couple of ways to do this...you can use the WhereCondition
parameter of OpenForm or the OpenArgs parameter. If you have constructed
the 2nd form properly, using the WhereCondition arguement will be easiest,
i.e.,

Docmd.OpenForm "Ticket Form",,,"SomeField=" & Me.lstSomeListValue

See help for additional info

--
Paul Overway
Logico Solutions, LLC
www.logico-solutions.com


Nick said:
Hello All,

I have a listbox in a form which I want the ability to have
the user double click an item in the listbox and then open another
form. The problem is that the other form runs a query which pulls in
information from 3 other tables. Is there a way that I can pass my id
from the listbox into the query for the form before opening up the
form?

Here is what I have now

DoCmd.OpenForm "Ticket Form", acNormal, , "ALTERNATEKETSUFFIX=" &
myrow, , , acNormal


Thanks for your help in advance,
Nick
 
Hi Paul,

Thanks for your input. I actually found out what the issue
was, I wasn't hardcoating in a single quote on both sides of my
variable. Once I did that, the query worked.

Thanks,
Nick
 
Back
Top