Update table field value from form entry

S

S Stewart

Hello,

Here's the code I'm using. I know it's incomplete, I'm probably
missing a bunch of code here:

Private Sub TuesClassAMPresent_AfterUpdate()
If TuesClassAMPresent = "Yes" Then
Tables!Attendance!TuesAMClass =
Forms!frmTuesdayAttendanceNEW!txtTAM.Value
End If
End Sub

What I'm trying to do is when Yes (Y autofills the rest and then enter
key is hit) is typed into a field in the subform, I want the value
which is showing on the main form field named txtTAM to be entered
into the Attendance table into the field TuesdayAMClass. There will
also be one more field txtTPM (Tuesday PM Class) whose value should be
filled in in the same way. So I don't think I can add a new record
for each instance, as I would prefer that one day hold all the
information for one student on one row (date, AM Class, PM Class).

The main form consists of a studentID combobox which when the
student's number is entered, all the unbound text boxes fill in with
firstname, lastname, TuesAMClass, TuesPMClass, TLunch. The main form
gathers its information from a query pulling data from tables which
include student information and class information.

The subform contains a date which is automatically filled in with the
current date, then Lunch, TuesAM, TuesPM labels each with Yes/No to be
typed in.

Please NOTE, I'm sure I would have been done long before now if not
for the special circumstances I'm working with. Our agency provides
services to adults who are blind and visually impaired, and staff and
volunteers are often blind or visually impaired, so everything I
create must be accessible as some use screen readers, often they don't
use the mouse, screen magnification is used, etc. The volunteer who
does attendance for our clientele at our agency is visually impaired,
computer illiterate and not very mouse savvy. I can't use checkboxes
because they are too tiny so I am going with "Yes/No" instead.

Also, the way the database is set up currently, all classes are
deleted at the end of each semester so the data is lost -- which only
gathers which students were signed up for which classes -- we are
trying now to gather daily attendance records for historical purposes.
That is why I want to have the value of the form field entered into a
separate table.

Two databases are involved here. A back end database with all the
data, and a front end for the user.

This is how I envision this form working. The volunteer opens the
Tuesday Classes Form. She has a list of student ID's with their name
on a piece of paper listed in very large font. Students dwindle in
one by one, sometimes 3-4 at a time. They tell her their name. She
examines the list to find their student ID number (eventually I expect
she'll memorize the ID numbers for each student). She enters the
student number into the appropriate box. The student's name, AM/PM
classes they are attending for the day fill into the boxes on the
screen. She verifies that they are attending Bingo in the morning and
Jewelry class in the afternoon, typing Y enter in the first field, Y
enter in the second field. With the act of typing Y enter into each
box, on the attendance table the names of the classes fill into the
rows.

Right now what happens is the Yes is filling in to the attendance
table, but the Classes field in the table remains blank. I think
ideally I would prefer the Yes to not even be there, but the class
name instead. But with the Yes there, we can easily run a count for
students attending all classes without having to enter all class names
if we have the Yes field.

Can someone help me with the missing coding, or am I totally off with
what I have thus far?

Thanks in advance,
Starlene
 
S

Sal Rosario

Not doable the way you are trying. Read about ADO or DAO recordset in the
Access documentation.
 

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