sub5
Programmer
- Oct 12, 2005
- 104
I have successfully been using a slightly modified version of Jazzz's code in this thread.
Need to Disable Close Button
thread702-686356 (see code below)
(I am using Access97)
However, on my form code toggles tabs between visible true/false. Sometimes when I reopen a form it appears to have saved the changes my code made during the previous data inputing operation ie the last tab is visible when I re-open the form instead of the first.
Can anyone tell me if this code is saving the changes my code is making to the control properties when a data inputer is using the form?
Option Compare Database
Option Explicit
Public pblnAllowClose As Boolean
Private Sub cmdExit_Click()
pblnAllowClose = True
DoCmd.Close
End Sub
Private Sub Form_Load()
pblnAllowClose = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
If pblnAllowClose = False Then
MsgBox "You cannot X out of the database, please use the EXIT button", vbOKOnly, "CANNOT X OUT"
Else
Cancel = False
End If
End Sub
Need to Disable Close Button
thread702-686356 (see code below)
(I am using Access97)
However, on my form code toggles tabs between visible true/false. Sometimes when I reopen a form it appears to have saved the changes my code made during the previous data inputing operation ie the last tab is visible when I re-open the form instead of the first.
Can anyone tell me if this code is saving the changes my code is making to the control properties when a data inputer is using the form?
Option Compare Database
Option Explicit
Public pblnAllowClose As Boolean
Private Sub cmdExit_Click()
pblnAllowClose = True
DoCmd.Close
End Sub
Private Sub Form_Load()
pblnAllowClose = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
If pblnAllowClose = False Then
MsgBox "You cannot X out of the database, please use the EXIT button", vbOKOnly, "CANNOT X OUT"
Else
Cancel = False
End If
End Sub