Things I had to do to get working:
1. Can't get any expression in Default property to work. Shows #Type! error and couldn't get it to go away. I had to remove expression for testing. Think I have encountered this before. Will have to find some other way to get the Seniority ID. I also could not get expression to work in any of the form events. Kept getting error message "Invalid use of the . (dot) or ! operator ...". Very weird.
2. Change date textbox Format property to Short Date.
3. The DLookup must search table for the combination of Seniority ID, VehicleID, and Beginning Shift Date.
Code:
If IsNull(vehCbo) Or IsNull(begShftDate) Then
MsgBox "You must enter a Vehicle Number and a Beginning Shift Date." _
& vbCrLf & "Please try again.", vbCritical, _
"More information required."
Else
If IsNull(DLookup("[Beginning Shift ID]", "tblShiftInfo", "[Vehicle Number]=" & Me.vehCbo _
& " AND [Seniority ID]=" & Me.senId & " AND [Beginning Shift Date]=#" & Me.begShftDate & "#")) Then
MsgBox "No such Date for the vehicle."
Exit Sub
End If
DoCmd.OpenForm "frmEndShiftInfo", acViewNormal
DoCmd.Close acForm, "frmEndShiftInfoForm"
End If
Combobox vehCBO is bound to the Vehicle Number field, not VehicleID. The VehicleID field in tblVehicles is not even needed if you are not using this value as foreign key in related tables. Vehicle Number should be primary key. Also, the combobox won't allow typing the Vehicle Number. Another weirdness. Don't think I have ever dealt with a combobox RowSource where the source field was number type. Even though it has only digits, the Vehicle Number isn't really a number, it is an identifier like SSN or phone#. Identifiers are ideally a fixed length string.