How to pass values to another form?

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top