Hello - I have a form built where the user can enter data, save it and leave if they needs to then come back to it but they cannot print it until all the required fields are completed - the following is the code to accomplish this:
If IsNull(Me.RecruitmentActions) Or IsNull(Me.TimeLeave) Or IsNull(Me.RequestNumberTextField) Or IsNull(Me.AddInfoCall) Or IsNull(Me.PhoneNumber) Or IsNull(Me.ProposedEffDate) Or IsNull(Me.ActionReqBy) Or IsNull(Me.RequestDate) Or IsNull(Me.ActionAuthBy) Or IsNull(Me.To_) Or IsNull(Me.ToPDNumber) Or IsNull(Me.ToPayPlan) Or IsNull(Me.ToOccCode) Or IsNull(Me.ToGradeLevel) Or IsNull(Me.ToNameLocation) Or IsNull(Me.WorkDescriptor) Or IsNull(Me.AppropriationCode) Or IsNull(Me.DutyStation) Or IsNull(Me.RemarksReqOfc) Or IsNull(Me.VICE) Or IsNull(Me.TeleworkIndCode) Then
MsgBox "One or more of the required fields for the RECRUITMENT 52 are empty - Please make sure you have filled out all boxes that are marked required for the RECRUITMENT 52."
Else
Dim stDocName As String
'MsbBox "value=" + RequestNumberTextField
stDocName = "OneRecruitment 52"
DoCmd.OpenReport stDocName, acNormal
End If
My question - someone is asking for the option to fill out three additional fields that are not always needed so they are not marked as required to print. If I add them to the code then no one can print unless they are filled out and they are needed only when a specific type of action is requested.
Is there a way to write code that would allow these extra fields to be added and have the form print even though they are not required? Maybe an If-Then statement - if Not Null then...
Or a different statement just for those fields?
Thank you for any help you can give me in advance.
Laura Edmark
If IsNull(Me.RecruitmentActions) Or IsNull(Me.TimeLeave) Or IsNull(Me.RequestNumberTextField) Or IsNull(Me.AddInfoCall) Or IsNull(Me.PhoneNumber) Or IsNull(Me.ProposedEffDate) Or IsNull(Me.ActionReqBy) Or IsNull(Me.RequestDate) Or IsNull(Me.ActionAuthBy) Or IsNull(Me.To_) Or IsNull(Me.ToPDNumber) Or IsNull(Me.ToPayPlan) Or IsNull(Me.ToOccCode) Or IsNull(Me.ToGradeLevel) Or IsNull(Me.ToNameLocation) Or IsNull(Me.WorkDescriptor) Or IsNull(Me.AppropriationCode) Or IsNull(Me.DutyStation) Or IsNull(Me.RemarksReqOfc) Or IsNull(Me.VICE) Or IsNull(Me.TeleworkIndCode) Then
MsgBox "One or more of the required fields for the RECRUITMENT 52 are empty - Please make sure you have filled out all boxes that are marked required for the RECRUITMENT 52."
Else
Dim stDocName As String
'MsbBox "value=" + RequestNumberTextField
stDocName = "OneRecruitment 52"
DoCmd.OpenReport stDocName, acNormal
End If
My question - someone is asking for the option to fill out three additional fields that are not always needed so they are not marked as required to print. If I add them to the code then no one can print unless they are filled out and they are needed only when a specific type of action is requested.
Is there a way to write code that would allow these extra fields to be added and have the form print even though they are not required? Maybe an If-Then statement - if Not Null then...
Or a different statement just for those fields?
Thank you for any help you can give me in advance.
Laura Edmark