hi i am trying to figure out some issues to do with null values of combo boxes for my db. Ive run through multiple different pages and used varying solutions to check for a null value of my combo boxes (ie nothing selected), all failing miserably for me so im thinking there may be an issue with my implimentation or my code in general.
My aim is to check the field qualid,
if it is null have the msgbox pop up saying
New qualification will not be saved due to incomplete recordsNAME. Would you like to proceed?", the yes/no functions leading to two different options
If qualid is not null then check the other fields too, there are 5 fields total. datetype has a default value hence doesnt need to be checked, 1 is a date field(date), 2 combo boxes (qualid, staffid), and a hyperlinked field(trainingrecord).
Any assistance in figuring out my problem/helping correct it would be much apprieciated as ive been scratching my head over this for the few days.
My aim is to check the field qualid,
if it is null have the msgbox pop up saying
New qualification will not be saved due to incomplete recordsNAME. Would you like to proceed?", the yes/no functions leading to two different options
If qualid is not null then check the other fields too, there are 5 fields total. datetype has a default value hence doesnt need to be checked, 1 is a date field(date), 2 combo boxes (qualid, staffid), and a hyperlinked field(trainingrecord).
Any assistance in figuring out my problem/helping correct it would be much apprieciated as ive been scratching my head over this for the few days.
Code:
If IsNull(Me.staffid) Then
If MsgBox("New qualification will not be saved due to incomplete recordsNAME. Would you like to proceed?", vbYesNo) = vbYes Then
Me.Undo
MsgBox "Record was not saved", vbOKOnly
DoCmd.Close
Else
MsgBox "Please select a staff name"
End If
Else
If IsNull(Me.qualid) Then
If MsgBox("New qualification will not be saved due to incomplete recordsQUAL. Would you like to proceed?", vbYesNo) = vbYes Then
Me.Undo
MsgBox "Record was not saved", vbOKOnly
DoCmd.Close
Else
MsgBox "Please select a qualification"
End If
Else
If IsNull(Me.date) Then
If MsgBox("New qualification will not be saved due to incomplete recordsDATE. Would you like to proceed?", vbYesNo) = vbYes Then
Me.Undo
MsgBox "Record was not saved", vbOKOnly
DoCmd.Close
Else
MsgBox "Please select a date"
End If
Else
If Nz(trainingrecord, "n/a") = "n/a" Then
If MsgBox("New qualification will not be saved due to incomplete recordsCERT. Would you like to proceed?", vbYesNo) = vbYes Then
Me.Undo
MsgBox "Record was not saved", vbOKOnly
DoCmd.Close
Else
MsgBox "Please attatch a training certificate"
End If
Else
DoCmd.Close
End If
End If
End If
End If
Last edited: