PDA

View Full Version : Solved: Pass Form Fields



jauner
12-27-2005, 09:32 AM
I have a form that has a list of locations. What I would like to do is have a user double click on a location and have it create a new records with the location filled in. I have created a docmd.openform in the event procedure for the double-click event but I am not sure how to pass that location. Do I just use openargs? If so I am such a novice at using openargs.

One item of note is that the form that is being double clicked on is a subformt that is in datasheet view.

Please help.

Thanks

nullZero
12-27-2005, 12:47 PM
Yes, you can use the openargs for this. All you need to do is pass a value in the openargs of your docmd.openform and then in your second form you need to define what to do with the openargs in the form_open event. like this...



Private Sub Form_Open(Cancel As Integer)
Me.yourTextBox = Me.OpenArgs
End Sub

OBP
01-01-2006, 12:16 PM
The other way to do this is with a Combo box for selecting the Location and use the "After Update" procedure of the Combo to popuate the required fields

jauner
01-03-2006, 08:11 AM
I have one more thing that came up regarding this. Is there a way to pass more then one value in openargs? Such as an account number and location? If so how does the system know they are separate?

jauner
01-05-2006, 12:33 PM
I ended up just setting the form values from the calling form.