chrisaroundtown
Technical User
Hi,
I have a form that is used for data entry. I don't want records with only half the information required. To combat this I have put in a check on my Submit button that will check each field to make sure it doesn't = "". If it does I throw up a messagebox.
I want to make sure every entry goes through this check so on the form I have a "Saved" field, when the submit button is clicked txtSaved = 1.
For the OnClose event of the form I want to say
If txtSaved <> 1 Then
MsgBox "Your entry has not been saved and will be deleted", vbOkOnly,"Not Saved"
'Then Delete the record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
End If
I am getting the error "The command or action SelectRecord isn't available now."
Any Ideas,
Chris
I have a form that is used for data entry. I don't want records with only half the information required. To combat this I have put in a check on my Submit button that will check each field to make sure it doesn't = "". If it does I throw up a messagebox.
I want to make sure every entry goes through this check so on the form I have a "Saved" field, when the submit button is clicked txtSaved = 1.
For the OnClose event of the form I want to say
If txtSaved <> 1 Then
MsgBox "Your entry has not been saved and will be deleted", vbOkOnly,"Not Saved"
'Then Delete the record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
End If
I am getting the error "The command or action SelectRecord isn't available now."
Any Ideas,
Chris