Parameter for DSum Function

H

Helmut

I am running an update query that uses the dsum function
with a criteria that is passed as a string in single
quotes. The criteria part of the dsum function looks like
this:
"[tblInvoiceLine].[strInvcNum]='F93481'"
This query works fine, it updates as it should.

But I need to parametrize the query, so that I can pass a
different criteria string to the dsum function each time I
run the query. I created the runtime parameter [Enter
number] and tried:
"[tblInvoiceLine].[strInvcNum]='[Enter number]'"
This does not update the fields any more (probably
evaluates the dsum to NULL).

What's the correct syntax?
 
V

Van T. Dinh

Try:

"[tblInvoiceLine].[strInvcNum]='" & [Enter number] & "'"

HTH
Van T. Dinh
MVP (Access)
 

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

Similar Threads

Parameter Query with DSum 1
dsum with multiple criteria and decimals 0
Dsum returns #Error 4
DSUM Syntax Error 1
DSum function 3
DSUM Function 2
DSum in Query 2
Use of the DSUM function 2

Top