dcount syntax

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

Guest

The followingcode works fine:
MsgBox Me![test unterformular].Form.AUFPOSID & "show the aufposid"

ct = Nz(DCount("*", "serial_number", "[aufpposid]= 15205"), 0)


MsgBox ct & "record count"

the msgbox returns 15205 and ctreturns 5

When I change the code to
ct = Nz(DCount("*", "serial_number", "[aufpposid]= Me![test
unterformular].Form.AUFPOSID"), 0)

it returns an error.

[aufpposid] is a long integer.

I can update the [aufpposid] field with Me![test unterformular].Form.AUFPOSID

Do I have a sysntax problem?
 
Try this:

ct = Nz(DCount("*", "serial_number", "[aufpposid]=" & Me![test
unterformular].Form.AUFPOSID), 0)
 
Back
Top