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!

Saving a value on a form -- from another form

Status
Not open for further replies.

Goot

Programmer
Aug 4, 2005
86
0
0
US
I have a form (form 1) that calls another form (form2).
Users can change and save info on form2. When they save the form2 record, I check off a check box on form 1.
Forms!frmAccount!(Me.txtCheckType.Value) = 0

However, when control passes back to form1, the user might cancel the form, or close the form, in that case, I lose the value from the above statement.

How can I get that value to "stick" from form2.



 
If the checkbox status is related to a specific record, you could have that value stored in a table with the record. If it's just a general 'this-is-where-we're-at-in-the-process' value, you can declare it as a public variable and use code to change the variable rather than tick a checkbox. Use the checkbox to reflect the value of the public variable rather than to set the value.

HTH


John

Use what you have,
Learn what you can,
Create what you need.
 
Form 1 has a save button on it, I would really like to invoke that save button right after I set the value of the checkbox. Is there a way to do it from form2.

I have tried a few different variations for instance
Call Forms.frmAccount!(Me.cmdSave)

Thanks
 
Code:
cmdSave_Click
is what I usually use to call the click event of a save button.

HTH

John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top