rikklaney1
Registered User.
- Local time
- Today, 07:17
- Joined
- Nov 20, 2014
- Messages
- 157
Ok, I have a table called constants. In this table are 10 records, operator-1 thru operator-10. Each of these have 30 fields called act1 thru act30.
Act1 thru act30 contain either a D for something the operator should do daily, an M for something the operator should do monthly or a 2 thru 6 for the day of the week the operator should do it.
Next I have a table for each operator, clntbl-1 thru clntbl-10. Each of these tables contain fields scdate, day(calculated by weekday(scdate)) and act1 thru act30 also but this time it will be daily records for what was scheduled and what was done by date. The records will be by date so on a date a field could have a value of "q" meaning it is scheduled on that date or a value of "s" meaning it was done on that date. This is done through a form. When the operator opens the form they see a list of items to be done on the date they opened the form and when they click it changes the value to show complete instead of scheduled.
Now what I would like to do is create a record a week in advance so I use this in the onopen event of the operators form
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("clntbl-rs1")
rst.AddNew
rst("Scdate") = Date + 7
rst.update
that works well but my question is what would be the best way to automatically set the field values for each activity when creating the record based on the values in the constants table? I have never tried learning relationships yet but this kinda seems like that type of thing.
Act1 thru act30 contain either a D for something the operator should do daily, an M for something the operator should do monthly or a 2 thru 6 for the day of the week the operator should do it.
Next I have a table for each operator, clntbl-1 thru clntbl-10. Each of these tables contain fields scdate, day(calculated by weekday(scdate)) and act1 thru act30 also but this time it will be daily records for what was scheduled and what was done by date. The records will be by date so on a date a field could have a value of "q" meaning it is scheduled on that date or a value of "s" meaning it was done on that date. This is done through a form. When the operator opens the form they see a list of items to be done on the date they opened the form and when they click it changes the value to show complete instead of scheduled.
Now what I would like to do is create a record a week in advance so I use this in the onopen event of the operators form
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("clntbl-rs1")
rst.AddNew
rst("Scdate") = Date + 7
rst.update
that works well but my question is what would be the best way to automatically set the field values for each activity when creating the record based on the values in the constants table? I have never tried learning relationships yet but this kinda seems like that type of thing.