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
 
Back
Top