Hi guys.
I have a few problems with my message box.
1. How do I enable a message to pop up only the first time I click a save button on a new record in a form?
2. How do I run the following
ONLY AFTER you click Yes on the message box?
After you click yes, it can be locked forever, but not before you click the save button or if you clicked No on the msg box.
3. For another command button, how do I disable it after you have clicked it, and not enable it again until after you enter some value into a text box?
My message box now:
I have a few problems with my message box.
1. How do I enable a message to pop up only the first time I click a save button on a new record in a form?
2. How do I run the following
Me.Home_Tel.Locked = True
Me.Student_Name.Locked = True
Me.Class_Enrolled.Locked = True
ONLY AFTER you click Yes on the message box?
After you click yes, it can be locked forever, but not before you click the save button or if you clicked No on the msg box.
3. For another command button, how do I disable it after you have clicked it, and not enable it again until after you enter some value into a text box?
My message box now:
Dim msg As String
'Ask user if they want to save the record.
msg = msg & "You cannot change Student Name and Course Enrolled after you save. Proceed? "
If MsgBox(msg, vbYesNo, "Warning") = vbYes Then
'Run the command
DoCmd.RunCommand acCmdSaveRecord
'Lock the following keys
Me.Home_Tel.Locked = True
Me.Student_Name.Locked = True
Me.Class_Enrolled.Locked = True
Else
Me.Home_Tel.Locked = False
Me.Student_Name.Locked = False
Me.Class_Enrolled.Locked = False
Exit Sub
End If