Dcount formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I format the last part of my DCount statement (Pri_responsible =
[lstReport].[Column](1)

Are there quotes or how would this work?

rptCount = DCount("[Auto]", "tblPI", "status = 'Open' And IsNull(Email2) =
True And ([Email1] < Date() - [Time1])And UserName = " & "'" & Me.txtUser &
"'" And Pri_responsible = [lstReport].[Column](1))



TIA
 
If [lstReport].[Column](1) is text, it would be:

rptCount = DCount("[Auto]", "tblPI", "status = 'Open' And IsNull(Email2) =
True And ([Email1] < Date() - [Time1])And UserName = '" & Me.txtUser &
"'" And Pri_responsible = '" & Me.[lstReport].[Column](1) & "'")

If [lstReport].[Column](1) is numeric, it would be:

rptCount = DCount("[Auto]", "tblPI", "status = 'Open' And IsNull(Email2) =
True And ([Email1] < Date() - [Time1])And UserName = '" & Me.txtUser &
"'" And Pri_responsible = " &Me.[lstReport].[Column](1) )

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

update query 1
docmd.runsql Update 5
calculate after first calculation 2
Complex DCount in a Student "Summary" Form 1
DCount vs something better? 6
DCOUNT Help 2
fiscal year 5
Formatting Dcount 1

Back
Top