By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,508 Members | 2,849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,508 IT Pros & Developers. It's quick & easy.

Answer to Saving Form With Required Field

P: 19
I had posted a question asking for help with printing only required fields on a form - both Sierra7 and Denburt answered me and gave me valuable information. I had to make it a little simpler to get it to work correctly but i figured out how to do it and wanted to let them know of my solution since I said I'd let them know what works:

The following code was written for the print button on the form:

Private Sub Command95_Click()
On Err Go To Err_Command95_Click

If IsNull(Me.Action_Requested) Or IsNull(Me.T_L) Or IsNull(Me.RequestNumberTextField) Or ....Etc thru all the fields Then
MsgBox "One or more required fields are empty - All boxes on the form must be filled out before you can print."

Else

Dim stDocName As String

'MsgBox "value=" + RequestNumberTextField

stDocName = "Recruitment 52"
DoCmd.OpenReport stDocName, acNormal

End If

Exit_Command95_Click:
Exit Sub

Err_Command95_Click:
MsgBox Err.Description
Resume Exit_Command95_Click

End Sub

Thank you both so much for your help!

Laura Edmark
Mar 10 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.