General discussion

Locked

MS ACCESS HELP

By ecollins ·
Ok, I have made a database that will input names,address,email address,whatever.I need another form that will get the first and last name form a table called tblmain, AND allow someone to click a checkbox which is attendance,and have it save the fact that that box was clicked for that person on that date.I have no idea how to do it. Please Help Me

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MS ACCESS HELP

by Stillatit In reply to MS ACCESS HELP

If tblmain is small, use it to populate a list on your new form to select a record in tblmain. If it is large, you may want to have the user type the first few letters of the last name and then hit a search button, look at a small list of possibilities, then select one.

Having selected a record in tblmain, if the user checks the box, create a new record in another table, tblattend. The fields in tblattend are the primary key of tblmain so that you can link the tables, and a date attended field. Note that the primary key in tblattend is the tblmain primary key PLUS the date. Make sure you do not try to add duplicate keys.

Good luck.

Collapse -

MS ACCESS HELP

by ecollins In reply to MS ACCESS HELP

sorry but I have no idea what you just said.

Collapse -

MS ACCESS HELP

by SuzanneRD In reply to MS ACCESS HELP

What I understand so far is that you have one form to input the names, addresses, and email into tblmain. You will need 2 more fields in your table, a yes/no field for Attendance, and a date field. On your new form, you?ll need a combo box control to find the appropriated person (or just use the navigation buttons to get to the right person), a checkbox control for the Attendance field, a control for the date field.

This will only work if you are displaying the date field on the form:
On the AfterUpdate event for the Attendance field, you?ll need the following code, assuming that your checkbox control is named ?ctl_Attendance?, your last name control is called ?ctl_LastName?, and your date control on the form is called ?ctl_AttendanceDate?:

If Me!ctl_Attendance = True Then
Me!ctl_AttendanceDate = Date

Else
'// If you need code to remove the date if the checkbox is unchecked, uncomment the follwing line.
Me!ctl_AttendanceDate = ""
End If

If you don't want to display the date field on your form, let me know and I can help you with that.

Collapse -

MS ACCESS HELP

by donq In reply to MS ACCESS HELP

You need three Tables:

1. People (you have that and I assume it has a Primary Key?) - if not make one.

2. Class This defines what subject was taught and has a Primary Key.

3. Attendance This Table Has a Complex Key with three fields:
Field 1: Date/Time formatted Short Date with a Now() Default.
Field 2: Foreign Key storing a "People" Primary Key value.
Field 3: Foreign Key storing a "Class" Primary Key value.

%This will allow many people to attent many classes on many dates without duplication and there is only one place to revise People,Class, ot Attendance data - your work is "normalized"! Congratulations and enjoy Access.

Collapse -

MS ACCESS HELP

by ecollins In reply to MS ACCESS HELP

what are you talking about?

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums