Calculation Location?

  • Thread starter Thread starter AnnMarie
  • Start date Start date
A

AnnMarie

I have a calculated field on my form called NumWaitList.
I originally placed the calculation in the OnCurrent event
as follows:

Me.NumWaitList=DCount("[id]","qryWaitList","
Code:
=Forms!
Course![Code]")

This worked fine.  However, I also have combo boxes at the
top of the form that find & bring up records using the
bookmark method, and the form opened to the first record.
I had some users over-writing this first record, instead
of going to a new record.

I then added the following code in the OnOpen Event so
that the form would open to a blank record:

DoCmd.GoToRecord acDataForm, "Course", acNewRec

Since adding this event, the combo boxes no longer work
and I get Runtime Error 2105:  You can't go to specified
record. You may be at the end of a recordset.

The GoToRecord command works for my other forms.  If I
take out the OnCurrent Code, it will work fine with this
form, too.

My question:  Is there somewhere else I can put this
calculation, so when the user brings up this record they
can get an accurate count of the number of students on the
waiting list?

Any comments or suggestions are greatly appreciated!

Thanks,
AnnMarie
 
I figured out what I needed to do...put the calculation in
an unbound text box on the form.
 
Back
Top