G
Guest
I'm having a small problem getting a msgbox to pop up on a form when the user
enters a number larger than a number stored in a related table. Here's the
code for the after update of the text box on the form:
Private Sub LeafLbs1_AfterUpdate()
If Me.LeafLbs1.Value > Me.Equipment.Column(3).Value Then
MsgBox "Wrong"
Cancel = True
End If
End Sub
The form (called dailyreport) is based on a master table of information.
There is another table, vehicles, linked to this table, which stores
information on the different vehicles that are used. I want a warning message
to come up if the user enters a vehicle weight that is higher than the
maximum weight stored in the vehicles table.
In the above vb code, i used Equipment.Column(3) because earlier on this
same form, the user has already entered the vehicle number in a text box
called Equipment. Since I figured this box is linked to the vehicles table, I
could simply call the number this way. Apparently not, since I can't seem to
get it to work.
Any ideas? I can provide more info if needed.
enters a number larger than a number stored in a related table. Here's the
code for the after update of the text box on the form:
Private Sub LeafLbs1_AfterUpdate()
If Me.LeafLbs1.Value > Me.Equipment.Column(3).Value Then
MsgBox "Wrong"
Cancel = True
End If
End Sub
The form (called dailyreport) is based on a master table of information.
There is another table, vehicles, linked to this table, which stores
information on the different vehicles that are used. I want a warning message
to come up if the user enters a vehicle weight that is higher than the
maximum weight stored in the vehicles table.
In the above vb code, i used Equipment.Column(3) because earlier on this
same form, the user has already entered the vehicle number in a text box
called Equipment. Since I figured this box is linked to the vehicles table, I
could simply call the number this way. Apparently not, since I can't seem to
get it to work.
Any ideas? I can provide more info if needed.