DCount()

L'apprentis

Redcifer
Local time
Today, 01:41
Joined
Jun 22, 2005
Messages
177
This is the first time I am trying to use the Dcount Function and I can't make it work; I don't see why? This is my code which Is very simple, is anybody sees any mistakes?

Code:
Private Sub TxtDrawingFile_AfterUpdate()

Dim StrDrawingCount As String
StrDrawingCount = DCount([DrawingFileID], TblDrawingFile, [DrawingFile] = Me!TxtDrawingFile)
Me!TxtEssai = StrDrawingCount

End Sub
 
If DrawingFile is a string
StrDrawingCount = DCount("[DrawingFileID]", "TblDrawingFile", "[DrawingFile] = '" & Me!TxtDrawingFile & "'")

Else

StrDrawingCount = DCount("[DrawingFileID]", "TblDrawingFile", "[DrawingFile] = " & Me!TxtDrawingFile )

HTH

Peter
 

Users who are viewing this thread

Back
Top Bottom