jivins1215
New Member
- Joined
- Aug 11, 2016
- Messages
- 2
I have a database tracking whether employees attend their meetings. For every meeting they attend they get paid. The attendance sheets get submitted by an upload form into my database as a Form with checkboxes for each employee. Now I want my VBA code to see that if the "AttndMeeting1" value is checked for an employee to also automatically check the corresponding "Paid1" value for the same employee. I also want the all the "AttndMeeting" and "Paid" fields on the form to be copied onto my MasterList of employees, which is in a table on the database. Since "AttndMeeting1" is a column on the table and form, there has to be a way for it to automatically pull from the form to the table, right?
This is what I have so far. The "Master_List" is the master list. I know I have a long way to go.
Sub UpdatePaidCheckbox()
Dim i As Integer
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Master_List")
For i = 0 To rs.RecordCount - 1
If rs.Fields("AttndMeeting1") = "Yes" Then
rs.AddNew
rs.Fields("Paid1") = "Yes"
rs.Close
Set rs = Nothing
db.Close
End Sub
This is what I have so far. The "Master_List" is the master list. I know I have a long way to go.
Sub UpdatePaidCheckbox()
Dim i As Integer
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Master_List")
For i = 0 To rs.RecordCount - 1
If rs.Fields("AttndMeeting1") = "Yes" Then
rs.AddNew
rs.Fields("Paid1") = "Yes"
rs.Close
Set rs = Nothing
db.Close
End Sub