Ok, after tring many things and viewing many pages! This is what I got to work.
Code:Private Sub Form_Close() Forms("frmParts").CheckValue End Sub
Ok, after tring many things and viewing many pages! This is what I got to work.
Code:Private Sub Form_Close() Forms("frmParts").CheckValue End Sub
Is there another way to write this code?Forms("frmParts").CheckValue
What does Forms! do in the code?
Forms("frmParts").CheckValue
should do the same thing as what I posted in post 6, with the new name. I just tested this from a different form and it worked as expected.
Code:Private Sub Command9_Click() Forms!Form1.TestFromDifferentForm End Sub
The function in Form1 named:
Code:Public Sub TestFromDifferentForm() ... End Sub
ran as expected.
Paul, yes it did run the same! Sorry! Not sure what I did wrong, but now I see there is another way. Is that what the ! does?
Code:Private Sub Form_Close() On Error Resume Next 'Forms("frmParts").CheckValue ' Update CheckValue when frmSearch is closed Forms!frmParts.CheckValue End Sub
Thanks for your help!
Tom
In general terms with both methods you're telling Access that what follows is the name of a form, so it will know where to look for the named function. If the function/sub was in a standard module you wouldn't have to include any of that, just the function/sub name. If the code happened to be behind a report rather than a form, it would be Reports! or Reports("...").
Thanks! that clears it up.