View Full Version : Me. and DCount


malsla
10-17-2006, 04:30 AM
Could anyone tell me what Me. is used for?
e.g.
Dim SID As String
SID = Me.strStudentNumber.Value

and also what is Dcount and what arguments does it take?

gemma-the-husky
10-17-2006, 05:39 AM
docunt counts instances of a given item in a given entitiy

hence dcount("*","tablename") counts all the records in the table tablename
while dcount("*","tablename",condition) counts the records matching a given condition. syntax of the condition can be awkward - it needs to look like the right side of a sql where clause

me refers to the current active screen control/form/report. its generally implied, but sometimes useful or necessary to pass as a parameter, and sometimes needed to reference an object.

eg me.requery forces the current form or control to reexecute its source query