VBA query syntax error

G

Guest

Hi, I am getting the following syntax error when I try to execute the query,
SELECT MAX(Master_Suppliers.supplier_id) AS s_id FROM Master_Suppliers.

Syntax error . in query expression 'SELECT MAX(Master_Suppliers.supplier_id)
AS s_id FROM Master_Suppliers'.

Any idea why this error is displayed ?
 
J

Jason Lepack

Try this, but if it doesn't work then actually post the code that you
are using.

SELECT MAX(supplier_id) AS s_id FROM Master_Suppliers
 
G

Guest

The code snippet is as follows.
DLast("s_id", "Master_Suppliers", "SELECT MAX(supplier_id) AS s_id FROM
Master_Suppliers")
Even now I am getting the same error.
 
J

Jason Lepack

The code snippet is as follows.
DLast("s_id", "Master_Suppliers", "SELECT MAX(supplier_id) AS s_id FROM
Master_Suppliers")
Even now I am getting the same error.

Instead of all that just use:
DMax("supplier_id", "Master_Suppliers")

Cheers,
Jason Lepack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top