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

passing value from one form to another 1

Status
Not open for further replies.

davyre

Programmer
Oct 3, 2012
197
AU
Hi,

I have a form named FrmDialogAutoAdd, which reads from the tblCustOrder. Beneath the FrmDialogAutoAdd, I have a variable named UnitID, and there is a button in that form that triggers to load another form called FrmDelta.
Now what I am asking is, how to pass the value of that variable (UnitID) into the FrmDelta, so that I can work around the code in FrmDelta using UnitID variable?
 
If you open the form in dialog you will have to pass the value in the open args parameter. If you do not open it dialog then you can just set the value from the calling form.
 
thanks for the reply. For the open args parameter, do you mean like this?
Code:
docmd.openform "FrmDelta", , , , , acDialog, UnitID

can I put two variables in the open args parameter?
 
You may use any string value for OpenArgs.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
so if I use
Code:
docmd.openform "FrmDelta", , , , , acDialog, UnitID & PONumber

how do I retrieve it in the other form and decide which is which?
is this correct?
Code:
xUnitID=CInt(Me.OpenArgs)
xPONumber=CInt(Me.OpenArgs)
 
What about this ?
DoCmd.OpenForm "FrmDelta", , , , , acDialog, UnitID & "," & PONumber

xUnitID = Val(Split(Me.OpenArgs, ",")(0))
xPONumber = Val(Split(Me.OpenArgs, ",")(1))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top