Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing information from list box form to another form

Status
Not open for further replies.

alh1002

Technical User
Mar 27, 2006
41
US
I have a form, which simply a list of dates and information from a query (which is simply a restatement of a table except for one criteria).

I want to be able to click on given record and then another form opens up which has all the info in the table for that date.

At the moment I have each form, but don't know how to make it so where I click knows which date to open up.

How can I read the date I am looking at and pass that as a variable and make is so the Form (form B) opens with that date .

example list has 5 dates and 2 pieces of information for each date

when I click on a given date I want the "detailed version" of that open up which is 12 fields, one of which is the date I just clicked.

 
Have a look at the OpenArgs argument of the OpenForm method...

Ken S.
 
Another way is the 4th argument of the DoCmd.OpenForm method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Oops, you're right PHV, that's the one I meant, actually...

[blush]
 
I saw something like that, but I have a list box, which isn't a record set. Can/should I just change the data source to record set and make the record set the SQL query? When I look at the properties of a listbox I don't see any option which makes me believe it comes from a record set.

How can I make a list box into a record set?
 
Actually a list box can have a recordset if its recordsource type is a table/query, but that is not necessary.

Code:
Private Sub List0_DblClick(Cancel As Integer)
   DoCmd.OpenForm "frmName", , , "theFieldNameToMatch = " & Me.List0
End Sub

Here is a double click event that pops up the form. This is what PHV was saying.
 
when i double click I am opening the form but the date has no effect it is just opening the new form at the beginning, is this because how the form is set up?

so what I want: Form1 has a summary table in the form of a list. Then a second form NAV_bound, has details of that record. What I want is after opening NAV bound I can scroll thru the records and make detail changes.

I orginally had NAV as unbound form, but I can't pass things to a unbound form. Hence the change.

Right now the NAV form is populated directly from the table, and I believe that is the problem.

Below is the what I believe is the problem code


Set Me.Recordset = rsNAV1
Me.dtladder_date.ControlSource = "ladder_date"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top