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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Data Selected in One Form Be Set in Another??

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
0
0
US
I have one form in which I enter a code, P_Type, depending upon which code I select, one of three different forms will open. P_type is in all of the forms. My questions is can the select code be entered into the P_Type combobox in the form so it does not have to be enter? Thank you for any assistance.
 
In the event which opens the form you need to add the following code...

forms![YourFormName]!p_type = me.[yourcomboname]

Hope that helps.
 
Thank you jode for the response. I entered that code in the ON ENTER and nothing happened. Any clues? Wrong location? Thank you again for the help.
 
There are at least two ways to do this.

First is to use the openargs arguments to pass the selected value to the form being opened. The help on openargs is fairly clear. Basically, any value you 'pass' to an opening form can be used by that form:

DoCMd.OpenForm "LaDiDa" , , , me!P_code
(Verify the number of placeholder commas - I only know that openargs is the LAST argument to the OpenForm method.

When "LaDiDa" opens, it will "know" about P_code.

The second requries that you allow the calling form to stay open, if not visible - then refer to the combo box on the first form, in the second form's P_code control source.

=Forms!MyFirstForm!P_code

Jim

Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Thank you both very,very much. It works now, I just had it in the wrong location.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top