Subform count

twosides

Registered User.
Local time
Today, 14:57
Joined
Jul 19, 2005
Messages
38
Hi Folks,
My problem is simple. I have 2 tables TrainDate and Staff of a simple traiing database.
I have a main form with a combobox on it that selects the training date. The subform is then the staff appertaining to the relavent date selected in the combobox. On the form I even have a simple unbound field that I use to indicate the number of persons booked on to the course. This pulls its data from a field in the SubForm footer that uses =Count([Name]) where 'name' is a field on the subform/table Staff.
On the Main form I have a unbound field that referances the subform field that I use to count the records: =dacSubForm!itemcount where "dacSubForm" is the subform and "itemcount" is the field on the subform with =Count([Name]) in it to calc the record total for that selection.

My problem is this. I want to use the record count total to either add a 1 or a 0 in to a field in the TrainDate table. My problem is that the count process seems to take a very short while. I am testing the process with a cmdButton and an IF statment to bring up an either/or MsgBox. This works fine as there is a little human delay between the button being pressed as apposed to when i use the form load event. I tried the combobox afterupdate event and this fails aswell.

How can i count the records in the subform and simply alter the contents in a field in the TrainDate table when i select the different combo box data.

cheers
 

Users who are viewing this thread

Back
Top Bottom