I have run myself into a hole I cannot get of and need some assistance. I have a Form "Frm_ATandT_Activation_Center" that has a sub form "Frm_ATandT_Activation". Frm_ATandT_Activation_Center is standard in Form View with no Master or Child links to the Sub form. this allows me to show available SIM ID"S in inventory for activation. The Subform diplays as a datasheet that has a Query as the control source. So when the user opens the form as a whole they see the listing of available SIM ID"S and 2 textbox controls to enter a remedy ticket number and an Employee ID. I am also Capturing the date and the employee's user name that activates the SIM. I have everything working except the CurrentDb.Execute statement to matchup all the entered data to the SIM that is being activated. here is my after update event of a combo box that the user chooses that corresponds with the SIM number to be activated.
Code:
Expand|Select|Wrap|Line Numbers
- Private Sub Text1_AfterUpdate()
- Dim strSim As String
- Dim strRemedy_Num As String
- Dim strEID As String
- Dim strUser As Variant
- Dim varRespond As Variant
- Dim strSQL As String
- Set Db = CurrentDb
- stDocName = "Frm_AtandT_Activation_Center"
- varSim = Me.SIM
- varUser = fOSUserName
- varEID = Forms.Frm_ATandT_Activation_Center.EID
- varRemedy = Forms.Frm_ATandT_Activation_Center.Remedy_num
- varUser = Forms.Frm_ATandT_Activation_Center.Text18
- Date = Forms.Frm_ATandT_Activation_Center.Used
- Respond = MsgBox("Are you Ready to issue this Sim -->" & varSim & " <-- to a Hand Held Device? " & _
- "Using Remedy Number " & varRemedy & vbCrLf & _
- " Employee ID Number " & varEID & " ?", vbYesNo, "Ready to Complete Activation? ")
- If Respond = vbYes Then
- CurrentDb.Execute "UPDATE tbl_SimInventory SET [Used] = " & Date & " , SET [UserNam] = " & varUser & " ,
- Set [Remedy_Num] = " & varRemedy & ", Set [EID] = " & varEID & " WHERE SIM = " & Me.SIM_list
- DoCmd.Close
- DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal
- If Respond = vbNo Then
- MsgBox "You may complete any changes needed for this activation", , " No Worries! "
- Forms.Frm_ATandT_Activation_Center.Used = Null
- Forms.Frm_ATandT_Activation_Center.Remedy_num = Null
- Forms.Frm_ATandT_Activation_Center.EID = Null
- Forms.Frm_ATandT_Activation_Center.UserNam = Null
- Me.Text1 = "Inventory"
- End If
- End If
- End Sub
My main goal is to fix my CurrentDb.Execute to enter the data to the corresponding SIM ID
Thank you so very much for your help.