I'm using the following code. It might not be the best way but it works so far. However I need to add something to it and when I try what I think is correct it bombs.
Private Sub txtPart_ID_Exit(Cancel As Integer)
If IsNull(Me.txtPart_ID) Then
DoCmd.RunMacro "mcrPartidok"
End If
If Me.txtUnitM = "LN" And IsNull(Me.txtLen) Then
DoCmd.RunMacro "mcrLinInch"
End If
If Me.txtUnitM = "SQI" And IsNull(Me.txtLen) Or IsNull(Me.txtWidth) Then
DoCmd.RunMacro "mcrSqInch"
End If
End Sub
Now what I need to add to this is the following:
If not(me.txtpart_id = dlookup("ID","tblparts"
then
msgbox "no such part" and also put a check mark in me.cckmaster
I've tried everything that I can think of. I'm just learning code so bear with me.
Private Sub txtPart_ID_Exit(Cancel As Integer)
If IsNull(Me.txtPart_ID) Then
DoCmd.RunMacro "mcrPartidok"
End If
If Me.txtUnitM = "LN" And IsNull(Me.txtLen) Then
DoCmd.RunMacro "mcrLinInch"
End If
If Me.txtUnitM = "SQI" And IsNull(Me.txtLen) Or IsNull(Me.txtWidth) Then
DoCmd.RunMacro "mcrSqInch"
End If
End Sub
Now what I need to add to this is the following:
If not(me.txtpart_id = dlookup("ID","tblparts"
msgbox "no such part" and also put a check mark in me.cckmaster
I've tried everything that I can think of. I'm just learning code so bear with me.