Locking Button

Stemdriller

Registered User.
Local time
Today, 07:34
Joined
May 29, 2008
Messages
187
Hi everyone.

I have a masterform and a subform.

In the subform if the user selects the save and exit button, I am trying to get the subform to close, which it does, but lock the Exit no save button on the MasterForm which is already open.

But I cannot get this button on the MasterForm to lock
So my code thus far is

Private Sub cmdSaveAndExit_Click()
If MsgBox("All changes have been saved", vbOKCancel) = vbOK Then
DoCmd.Close acForm, "frmElectricalIsolation2", acSaveYes

Else

End If

End Sub

Any help??

Regards

Gareth
 
the subform isn't a form. it's an object on the main form.

you may be able to say something like

Code:
parent!somefield.setfocus 'as you can't make a form invisible while it has the focus, i don't think.
me.visible = false
 
Hi Dave

Thanks for responding.
The main form (frmAddPermit) has 4 subforms. One of the subforms has an option that when pressed a hidden form appears. When this 'hidden' form is closed I am then trying to lock a button back on the frmAddPermit, which should still be open.

But I just cannot get any focus on it. The hidden form closes fine and any data is saved.
 
Hi Dave

Thanks for responding.
The main form (frmAddPermit) has 4 subforms. One of the subforms has an option that when pressed a hidden form appears. When this 'hidden' form is closed I am then trying to lock a button back on the frmAddPermit, which should still be open.

But I just cannot get any focus on it. The hidden form closes fine and any data is saved.

Sorted it now, thanks anyway
 

Users who are viewing this thread

Back
Top Bottom