Answer to Saving Form With Required Field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ledmark
    New Member
    • Oct 2007
    • 19

    Answer to Saving Form With Required Field

    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_C lick

    If IsNull(Me.Actio n_Requested) Or IsNull(Me.T_L) Or IsNull(Me.Reque stNumberTextFie ld) 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=" + RequestNumberTe xtField

    stDocName = "Recruitmen t 52"
    DoCmd.OpenRepor t stDocName, acNormal

    End If

    Exit_Command95_ Click:
    Exit Sub

    Err_Command95_C lick:
    MsgBox Err.Description
    Resume Exit_Command95_ Click

    End Sub

    Thank you both so much for your help!

    Laura Edmark
Working...