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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Cannot select items in listbox 1
Listbox query 3
Listbox to open a form (primary key text) 2
ListBox help 1
Non Update Form 6
Opening Form to specified record 1
Evaluate ListBox Value 8
Listbox 4

Back
Top