I’ve got the following code, it worked a few times, and now just won’t. Any ideas?
Private Sub FUIC_AfterUpdate()
Dim strSQL As String, x As String, Response As Integer
If Me.FUIC = “” Then
x = InputBox(“Enter RUC for reserve unit or MCC for active duty”, “Input Value”)
y = InputBox(“Enter unit name/street address, no abbreviations!”, “Input Value”)
z = InputBox(“Enter city of unit, no abbreviations!”, “Input Value”)
w = InputBox(“Enter state of unit, no abbreviations!”, “Input Value”)
v = InputBox(“Enter zip code of unit, no abbreviations!”, “Input Value”)
u = InputBox(“Enter phone number of reserve unit, no parenthesis, hyphens, or spaces!”, “Input Value”)
t = InputBox(“Enter Officer or General. Officer or General only!”, “Input Value”)
s = InputBox(“Enter CONUS, OCONUS, RESERVIST, HAWAII, CUBA, or SPAIN.”, “Input Value”)
r = InputBox(“Enter standard reservist endorsement.”, “Input Value”)
strSQL = “Insert Into tblUnits ([UIC], [Unit_name_street_address], [City], [State], [Zip], [Phone], [CO], [Orders_type], ” & _
“[Endorsement]) values (‘” & x & “‘, ‘” & y & “‘, ‘” & z & “‘, ‘” & w & “‘, ‘” & v & “‘, ‘” & u & “‘, ‘” & t & “‘, ‘” & s & “‘, ‘” & r & “‘);”
CurrentDb.Execute strSQL, dbFailOnError
Response = acDataErrAdded
Me.FUIC.Requery
Me.FUIC = x
Else
End If
End Sub