What is purpose of requiring this? What do you want done with the input - populate field on form? Is WorkOrderNumber another field on the form? Is it set to Required in the table?
Examples of code with InputBox:
Code:
While strTest = "?"
strTest = InputBox("Select Test Method (Enter 1 thru 5): " & vbCrLf & _
"1. T84" & vbCrLf & "2. T100" & vbCrLf & "3. T209" & vbCrLf & "4. T228" & vbCrLf & "5. T304", "Edit Calibrations", "?")
If strTest Like "[1-5]" Then
DoCmd.OpenTable "PycCal" & Choose(strTest, "T84", "T100", "T209", "T228", "T304")
If strTest = 4 Then
If MsgBox("Do you want to open the T228 spreadsheet?", vbYesNo) = vbYes Then FollowHyperlink ("\\dotatufs02\Crm\Lab\Calibration\SpG Pycnometers\T228.xlsx")
End If
ElseIf strTest <> "" Then
MsgBox "Not a valid entry. Select 1 through 5 or Cancel."
strTest = "?"
End If
Wend
_____________________________
Do
strTestTime = InputBox("Enter a time value for test number 800 - Special Testing.")
Loop Until IsNumeric(strTestTime) Or Len(strTestTime) = 0
_____________________________
strRDC = IIf(strMode = "Draft", "X", "?")
While strRDC = "?"
strRDC = UCase(InputBox("Enter item ID for report distribution:" & vbCrLf & vbCrLf & _
" 1 - Highway Construction" & vbCrLf & vbCrLf & _
" 2 - Preconstruction" & vbCrLf & vbCrLf & _
" 3 - HAP/ACP Mix Designs" & vbCrLf & vbCrLf & _
" 4 - Northern Region" & vbCrLf & vbCrLf & _
" 5 - Southeast Region" & vbCrLf & vbCrLf & _
" 6 - Accepted Products" & vbCrLf & vbCrLf & _
" 7 - M&O Central Region" & vbCrLf & vbCrLf & _
" 8 - Special" & vbCrLf & vbCrLf & _
" 9 - Aviation Construction" & vbCrLf & vbCrLf & _
" 10 - Concrete Mix" & vbCrLf & vbCrLf & _
" 11 - AIA Field Maintenance" & vbCrLf & vbCrLf & _
" N - Number File" & vbCrLf & vbCrLf & _
" X - Copy not for distribution nor filing", "Distribution", "X"))
If (Val(strRDC) > 0 And Val(strRDC) < 12) Or strRDC Like "[N,X]" Then
'continue with report print
If IsNumeric(strRDC) Then strRDC = "D" & strRDC
ElseIf strRDC <> "" Then
MsgBox "Not an appropriate entry.", vbApplicationModal, "Entry Error"
strRDC = "?"
Else
GoTo Exit_proc
End If
Wend
_____________________________
strInput = "?"
While strInput = "?"
strInput = InputBox("Select Flat-Elongated ratios to test." & vbCrLf & vbCrLf & _
" 3 1:3" & vbCrLf & vbCrLf & _
" 5 1:5" & vbCrLf & vbCrLf & _
" B Both")
If strInput = "3" Or strInput = "5" Or strInput = "B" Then
Condition = UCase(strInput)
Else
MsgBox "Not an appropriate entry.", vbApplicationModal, "Entry Error"
strInput = "?"
End If
Wend