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

Transfering data from on form to another

Status
Not open for further replies.

pwbrown

Technical User
Mar 8, 2006
13
0
0
US
On the main form there are a series of buttons, each one representing a different area.

Once clicking the button a new form opens. What I would like to have happen is that when the area button is clicked the field [area] on the new form is automatically filled in with the appropriate area. This would avoid people accidentally entering the wrong area. Each area is a simple number. Like if they click the button that reads "AREA 23" the [Area] field on the form that opens will automatically have "23" in it. This way I can have one form and not worry about people tring to enter "AREA 23" in the [area] field and getting errors back.
 
Have a look at OpenArgs

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Not sure what you mean by OpenArgs? Don't mean to sound stupid, but this is rather new to me.
 
When in VBE (Ctrl+G) feel free to play with the F2 and F1 keys.
 
You may also want to use a reference to the main form as a default value, or load the value using the form_load event

forms!mainform.ctrlname

of course you want to use your names not these samples
 
I have tried this, but the error
Can't assign a value to this object
keeps coming up when the button is clicked...

Button on click
Dim AreaNumber As String

AreaNumber = 7961

DoCmd.OpenForm "frmPullChordTracking", , , , , , AreaNumber


other form On Open event
Me.Text43 = Me.OpenArgs


Any ideas??
 
Try the other form Load event instead of the Open one.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top