troubleshooting Question

trying to run vba code that will use a value from an input box in a query

Avatar of VGuerra67
VGuerra67 asked on
Microsoft AccessVBA
5 Comments1 Solution89 ViewsLast Modified:
Here is the code.
Dim PriAcct, FamAcct As String
    '
    ' Get the data
    '
    PriAcct = InputBox("ENTER THE PRIMARY ACCOUNT:", "PRIMARY ACCOUNT INPUT BOX")
    '
    ' Check to see if any data was entered
    '
    If PriAcct <> "" Then
        '
        ' Run the table updates
        '
        SQL_Update_Appt_Qry = "UPDATE ClientInfo INNER JOIN tblAppointments ON ClientInfo.ClientID = tblAppointments.ClientID_FK SET tblAppointments.DisplayName = [ClientInfo]![DisplayName], tblAppointments.PrimaryClientName_C = [ClientInfo]![PrimaryClientName_C], " & _
        " tblAppointments.DisplayNameM = [ClientInfo]![DisplayNameM], tblAppointments.DisplayNamePC = [ClientInfo]![DisplayNamePC], tblAppointments.DisplayNameFM = [ClientInfo]![DisplayNameFM], tblAppointments.MaritalStatus = [ClientInfo]![MaritalStatus], tblAppointments.FamilyMember_C = [ClientInfo]![FamilyMember_C] " & _
        " WHERE (((tblAppointments.RIGAcct)= PriAcct))"
        DoCmd.RunSQL SQL_Update_Appt_Qry

This is giving me a syntax error (missing operator)
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros