Hello to all
I have a DB at work that tracks tire positions on our trucks by a number stamped on the tire. The code below works like this if the current location is a truck number then a small form pops up with a diagram of the front and rear of a truck (by textboxes) allowing you to go into the corresponding textbox and removing the tire number of the truck. Some tires are in the inventory room. So when the "Location" textbox is change to "inv_room", that pop up does not need to open (maybe a msgbox saying this is not a truck).
Note: when changing the info in the "location" textbox from lets say...an example from trk# 300791 to Inv, the popup box should come up linking the truck number so that the position can be changed.
Any help is appreciated.
JZ
Testkitt2
I have a DB at work that tracks tire positions on our trucks by a number stamped on the tire. The code below works like this if the current location is a truck number then a small form pops up with a diagram of the front and rear of a truck (by textboxes) allowing you to go into the corresponding textbox and removing the tire number of the truck. Some tires are in the inventory room. So when the "Location" textbox is change to "inv_room", that pop up does not need to open (maybe a msgbox saying this is not a truck).
Note: when changing the info in the "location" textbox from lets say...an example from trk# 300791 to Inv, the popup box should come up linking the truck number so that the position can be changed.
Code:
Private Sub Location_AfterUpdate()
Dim stDocName As String
Dim answer As Integer
Dim stLinkCriteria As String
If IsNumeric(Me![Location]) Then
answer = MsgBox(" Do You Want To Add or Remove Tire Positions ? !", vbQuestion + vbYesNo, "DB Admin")
If answer = vbNo Then
Exit Sub
Else
stDocName = "FrmTirePosition"
If IsNumeric(Me![Location]) Then
stLinkCriteria = "[Fleet Number]=" & "'" & Me![Location] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
End If
End Sub
Any help is appreciated.
JZ
Testkitt2