R
Roger
I am attempting to do a record count on a column in a
subform. When I use the DCount, I retrieve the total
number of records from the table the subform is based on.
If I use the Count function, I get only the number of
records present in the subform column. Unfortunatly I
cannot use the Count function because I want to exclude
certain values from the count. Here is how my form is set
up:
Main form is FA Schedule, contains employee name and ID
number from the employee table. Subform is Schedule
subform, contains employee schedule information from the
Schedule table. The fields in this table are Time,
Sunday....Saturday.When I use =DCount
("[Monday]","[Schedule]","[Monday] Between 1 and 700") in
a textbox located in the subform form footer I return 21
records for Monday, which is true if I want the number of
records for all employees. But in this case I only want
the number of records for the current employee displayed,
so the number should actually be 11.Any suggestions on
how I can remedy this problem will be appreciated.
Although I am novice at this, I am not adverse to using
VB or VBA to accomplish my goal.
To verify that I have the correct name of the subform, I
recreated the subform and checked the name.
These are the variations of DCount I have used to try and
puul the information for the current employee from the
table.
=DCount("[Monday]","[Schedule]","[Monday] Between 1 and
700 AND [FADevRyID] = " & [Forms]![Schedule subform]![
FADevRyID]) Returns #Name?
=DCount("[Monday]","Schedule","[Monday]") Returns all
records for Monday from table
=DCount("[Monday]","Schedule","[Monday] Between 1 and
750") Returns all records for Monday from table
=DCount("[Monday]","Schedule","[Monday]=" & Form.[Faculty
Assistant Schedule]) Returns #Name?
=DCount("Monday","[Schedule]","[Monday]= '" & Me.
[Schedule subform] & "'") Returns #Name?
=DCount("[Monday]","Schedule","[Monday] =" &
[Forms].Schedule) Returns #Name?
=DCount("[Monday]","Schedule","[Monday]=" & Form.
[Schedule subform]) Returns #Name?
subform. When I use the DCount, I retrieve the total
number of records from the table the subform is based on.
If I use the Count function, I get only the number of
records present in the subform column. Unfortunatly I
cannot use the Count function because I want to exclude
certain values from the count. Here is how my form is set
up:
Main form is FA Schedule, contains employee name and ID
number from the employee table. Subform is Schedule
subform, contains employee schedule information from the
Schedule table. The fields in this table are Time,
Sunday....Saturday.When I use =DCount
("[Monday]","[Schedule]","[Monday] Between 1 and 700") in
a textbox located in the subform form footer I return 21
records for Monday, which is true if I want the number of
records for all employees. But in this case I only want
the number of records for the current employee displayed,
so the number should actually be 11.Any suggestions on
how I can remedy this problem will be appreciated.
Although I am novice at this, I am not adverse to using
VB or VBA to accomplish my goal.
To verify that I have the correct name of the subform, I
recreated the subform and checked the name.
These are the variations of DCount I have used to try and
puul the information for the current employee from the
table.
=DCount("[Monday]","[Schedule]","[Monday] Between 1 and
700 AND [FADevRyID] = " & [Forms]![Schedule subform]![
FADevRyID]) Returns #Name?
=DCount("[Monday]","Schedule","[Monday]") Returns all
records for Monday from table
=DCount("[Monday]","Schedule","[Monday] Between 1 and
750") Returns all records for Monday from table
=DCount("[Monday]","Schedule","[Monday]=" & Form.[Faculty
Assistant Schedule]) Returns #Name?
=DCount("Monday","[Schedule]","[Monday]= '" & Me.
[Schedule subform] & "'") Returns #Name?
=DCount("[Monday]","Schedule","[Monday] =" &
[Forms].Schedule) Returns #Name?
=DCount("[Monday]","Schedule","[Monday]=" & Form.
[Schedule subform]) Returns #Name?