Moving focus from Subform to Mainform

AdamAA

Registered User.
Local time
Today, 17:21
Joined
Aug 18, 2012
Messages
24
Hi,

I want to press a button on the Subform, have it save the record then move focus back to the Mainform. Then make the Subform invisible.

I've tried this so far but it won't work:

RunMenuCommand
SaveRecord

GoToControl
Forms!MainForm

SetProperty
Control Name Subform
Property Visible
Value False


Saving the record works, and hiding the subform works, but changing focus to the MainForm comes up with an error ('There is no field 'Forms!Mainform' in the current record).
I've also tried 'Forms!MainForm!Text57' to make it change focus to a specific field but that's not working either. Any thoughts? I'd rather do this in a macro than in VBA.
 
I am not 100% sure (I do not work with macros much), but I think you would need to use the OpenForm command, then if necessary use the GoToControl to get to a specific item on the form.

I hope this helps.
 
In the macro, for gotocontrol, you should not write the whole syntaxt else just use the control name text57.

regards,
 

Users who are viewing this thread

Back
Top Bottom