where is OnCurent in 2002

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

In access 97 I used OnCurrent to keep my Combo box in sync
with the record.
How does it work with 2002.

Also, I've created an expresion to come up with a unique
id number for students. What is the best way to
automatically enter this in the
tblStudent, Field [CertNumber}

I have the Control source for [StudCerttxt] as
=[StudentID] & [ClassCode]
and manually copy it now.


TYIA
Randy
 
In access 97 I used OnCurrent to keep my Combo box in sync
with the record.
How does it work with 2002.

Exactly the same way. Why? What problem are you having?
Also, I've created an expresion to come up with a unique
id number for students. What is the best way to
automatically enter this in the
tblStudent, Field [CertNumber}
I have the Control source for [StudCerttxt] as
=[StudentID] & [ClassCode]
and manually copy it now.

If you want to do this (and see below why I think that you DON'T), use
the AfterUpdate events of both of these controls:

Private Sub StudentID_AfterUpdate()
If IsNull([StudentID]) OR IsNull([ClassCode]) Then Exit Sub
Me![CertNumber] = Me![StudentID] & Me![ClassCode]
End Sub

and the same for ClassCode.

Note that THIS FIELD SHOULD NOT EXIST. You can make StudentID and
ClassCode a joint two-field Primary Key, and display the concatenation
as a calculated expression, rather than violating atomicity and
storing data redundantly!
 
Back
Top