How to pass values to another form?

M

Me

I want to pass 4 values to another form that I am calling from main form (its
not a subform). How can I do so?

I tried

DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me![CONTRACT_NO] +
Me![TNO] + Me![QUEUENO] + Me![PHASENO]

and then how to retrieve it in the called form? something similar to
Me.OpenArgs, I should be able to get argument 1, 2, 3 & 4.

I have already moved values to stDocName and stLinkCriteria.

In DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me![CONTRACT_NO] +
Me![TNO] + Me![QUEUENO] + Me![PHASENO]

should I use something like [CONTRACT_NO]=Me![CONTRACT_NO] +[TNO]=Me![TNO]
.....
or how can I get value for each of the argument?


Thank you very much for your help!
-Me
 
J

Jeff Boyce

Consider not passing the values.

Instead, when the other form opens, you could "look back" at the controls in
the first form and grab the values, using something like:

Forms!YourFirstForm!YourFirstControl

as a reference from within the second form.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Me

Thank Jeff,

This is what I was looking for ...
-Me

Jeff Boyce said:
Consider not passing the values.

Instead, when the other form opens, you could "look back" at the controls in
the first form and grab the values, using something like:

Forms!YourFirstForm!YourFirstControl

as a reference from within the second form.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Me said:
I want to pass 4 values to another form that I am calling from main form
(its
not a subform). How can I do so?

I tried

DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me![CONTRACT_NO] +
Me![TNO] + Me![QUEUENO] + Me![PHASENO]

and then how to retrieve it in the called form? something similar to
Me.OpenArgs, I should be able to get argument 1, 2, 3 & 4.

I have already moved values to stDocName and stLinkCriteria.

In DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me![CONTRACT_NO] +
Me![TNO] + Me![QUEUENO] + Me![PHASENO]

should I use something like [CONTRACT_NO]=Me![CONTRACT_NO] +[TNO]=Me![TNO]
....
or how can I get value for each of the argument?


Thank you very much for your help!
-Me
 
Top