list box isnt referencing correct record

M

Mark

Hi,

I have a class-scheduling database that I need help with.
First, I have a form that employees can register for a
class (classes are initially set up by an administrator in
form, which populates a class table. The class
registration form/information populates a
table, "tableClassRegistration", which has the following
fields: ClassID, EmployeeID, EmployeeLName, EmployeeFName,
WorkPhone (in addition, the table has ClassApproved and
Comments. Next, a form, "formClassApproval", is based on
table, "tableClassRegistration", that allows an
administrator to approve/disapprove the employee
registration and add comments. So,
the "formClassApproval " has three controls/fields:
approve/disapprove (a yes/no check box), comments (a text
box that allows a memo to be added), and a third control
(a list box that is populated from a query based on
the "tableClassRegistration", which has a criteria "Is
Null" in the "ClassApproved" field that returns all
records that have not been approved/disapproved yet.

Have I lost you yet?

My problem lies in the form, "formClassApproval". The
list box returns all records that have not been
approved/disapproved yet, but when I select a record in
the list box and fill in the yes/no check box and add
comments. the information is being saved in the first
record only. not in the corresponding record selected from
the list box.

My question: how can I get the list box, listing all of
the records and fields that have not been
approved/disapproved, to allow me to select a record in
the list box and then fill in the yes/no check box and
comments. and to have that information (check box and
comments) being saved to their corresponding record?

Thanks for your assistance!!!
 
T

Tim Ferguson

"tableClassRegistration", which has the following
fields: ClassID, EmployeeID, EmployeeLName, EmployeeFName,
WorkPhone (in addition, the table has ClassApproved and
Comments. N

Ummm: I don't see how a Registration can have a name or a phone number.
Should not these be attributes in the "tableEmployee" table?


My question: how can I get the list box, listing all of
the records and fields that have not been
approved/disapproved, to allow me to select a record in
the list box and then fill in the yes/no check box and
comments. and to have that information (check box and
comments) being saved to their corresponding record?


Umm; you need to catch the AfterUpdate event in the listbox, and point the
form to the correct record. You can either set the RecordSource to
something like

"SELECT ALL ClassID, ClassApproved, Comments " & vbCrLf & _
"FROM tableClassRegistrations " & vbCrLf & _
"WHERE ClassID = " & lisSelectClassID.Value & "; "

or you can try manipulating the RecordSetClone and the Bookmark property,
which is just about as easy.


On the other hand, you might make things easy for yourself, and just let
the user thumb through the recordset using the video control buttons on the
form.

Hope that makes things a bit clearer.
B Wishes


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top