Rabu, 15 Oktober 2025

Re: [MSAccessProfessionals] Runtime Error '3075' Syntax error in query expression

Never mind.  I just figured out the problem was with the parenthesis. Too many in some places and they weren’t balanced. 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Doyce Winberry via groups.io
Sent: Wednesday, October 15, 2025 7:19 AM
To: MSAccessProfessionals@groups.io
Subject: [MSAccessProfessionals] Runtime Error '3075' Syntax error in query expression

 

Hello friends, I need help with syntax on an SQL statement. It is pulling criteria from a combo box. I want it up update a field, UPDATED_58 from “N” to “Y” for records with a batch number (text field) that comes from

ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Hello friends,

 

I need help with syntax on an SQL statement.  It is pulling criteria from a combo box. I want it up update a field, UPDATED_58 from “N” to “Y” for records with a batch number (text field) that comes from a combo box.  I’m getting a runtime error 3075, syntax error in query expression and can’t figure out what is wrong.  Here is the SQL from VBA:

strSQL = "UPDATE [Work General Ledger] SET [Work General Ledger].UPDATED_58 = ""Y""" & _

        " WHERE ((([Work General Ledger].UPDATED_58)=""N"") AND (([Work General Ledger].BATCH_58)= '" & [Forms]![frmOracleGLUpload]![cboBatch] & "' AND (([Work General Ledger].FROM_58)=""GL""));"

  

000006532 is the text field with the batch number for this example.  Here is what I get with debug.print:

UPDATE [Work General Ledger] SET [Work General Ledger].UPDATED_58 = "Y" WHERE ((([Work General Ledger].UPDATED_58)="N") AND (([Work General Ledger].BATCH_58)= '000006532' AND (([Work General Ledger].FROM_58)="GL"));

 

Thanks in advance. 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

Tidak ada komentar:

Posting Komentar