Good Morning,
I'm an amateur when it comes to code. I have two strings that work, but they won't work together. I have Dim strSQL As String and then two strSQL statements. Only one will work, the other does nothing. How can I combine them? They both work, but not together. I can't come up with the right sequence to make then work simultaneously.
Dim strSQL As String
strSQL = "UPDATE tblCutSheet SET Customer_Name = " & Chr(34) & Me.Customer_Name & Chr(34) & " WHERE Account_Number = " & Me.Account_Number
strSQL = "UPDATE tblCutSheet SET Customer_Phone = " & Chr(34) & Me.Customer_Phone & Chr(34) & " WHERE Account_Number = " & Me.Account_Number
CurrentDb.Execute strSQL, dbFailOnError
MsgBox "Account Number" & " " & Me.Account_Number.Value & " " & "has been Added to the Cut Sheet"
End Sub
(I cannot take credit for this code, another user/admin from this group helped me to create this) Works flawlessly for me.
I'm an amateur when it comes to code. I have two strings that work, but they won't work together. I have Dim strSQL As String and then two strSQL statements. Only one will work, the other does nothing. How can I combine them? They both work, but not together. I can't come up with the right sequence to make then work simultaneously.
Dim strSQL As String
strSQL = "UPDATE tblCutSheet SET Customer_Name = " & Chr(34) & Me.Customer_Name & Chr(34) & " WHERE Account_Number = " & Me.Account_Number
strSQL = "UPDATE tblCutSheet SET Customer_Phone = " & Chr(34) & Me.Customer_Phone & Chr(34) & " WHERE Account_Number = " & Me.Account_Number
CurrentDb.Execute strSQL, dbFailOnError
MsgBox "Account Number" & " " & Me.Account_Number.Value & " " & "has been Added to the Cut Sheet"
End Sub
(I cannot take credit for this code, another user/admin from this group helped me to create this) Works flawlessly for me.