Save Value of Field and use it once form closed

mercredi 22 avril 2015

Hi there,

Thanks for any help you can offer,

I have a MainForm.

Using a button on the MainForm i open an PopUp form which I enter values.

I want to save the value of a field (text), close the PopUp form.
Then use the Saved value in the MainForm to find a record.

So far I have this but not working:

Code:

TempVars.Add "company", Me.CompanyName.Value
If Me.Dirty = True Then
Me.Undo
End If
DoCmd.Close
DoCmd.OpenForm "MainForm"
DoCmd.Requery
DoCmd.FindRecord Forms![MainForm]![CompanyName] = TempVars("company")
DoCmd.GoToControl "Combo48"

Save Value of Field and use it once form closed

0 commentaires:

Enregistrer un commentaire

Labels