passing values between forms?!?

  • Thread starter Thread starter Highlands Mining P/L
  • Start date Start date
H

Highlands Mining P/L

hi,

i've got another question regarding linking forms and displaying
information.

I want to select something from a listbox (on the first form) and i want the
2nd form to open with information from the database regarding the selection
from the listbox on the first form.

e.g. if i have a listbox of different projects say, project A, project B and
project C. I want to select Project A and i want to go to the next form
which has information about project A....e.g project name, start date etc.
But if i select project B, i want to load a form that has info about that
project. I dont want to create 3 different forms, one for each project. i
just want one form that can change the displayed information.

thanks!
 
I had a similar situation recently.. what I did, and worked fine, is this:
The second form's recordsource is the table or query (project data in your
case), unfiltered.
The on double-click event of the list box on the first form opens the second
form, and applies a filter based on the value of the list box (single
selection).

Here's my sample code:

customer = Forms("Customer_Selection").Controls("Cust_List")
DoCmd.OpenForm "Customer_Form", acNormal, , "CusNo = '" & customer & "'"

HTH,
Nikos
 
Back
Top