Well sense noone want ed to help me with my first question, I decided to start this on on own. First question is should I be in a Sub, Function or Other? Next how does this thing know which table the data is in? I thought I would try a loop then send it to a second loop, did I do this right? Here is my attempt:
Private Procedure
Dim dbs As Database
Dim rst As Recordset
Dim EmploeeNumber As String
Dim DateWeekStarting As Date
Dim WorkDay1Reason As String
Dim WorkDay2Reason As String
Dim WorkDay3Reason As String
Dim WorkDay4Reason As String
Dim WorkDay5Reason As String
Dim strSQL
Set dbs = CurrentDb
Sub AttendenceDays()
DayCounter = 0
Do
If WorkDay1Reason = " " Or WorkDay1Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay2Reason = " " Or WorkDay2Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay3Reason = " " Or WorkDay3Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay4Reason = " " Or WorkDay4Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay5Reason = " " Or WorkDay5Reason = "HolD-A" Then
DayCounter = DayCounter + 1
Loop Until DayCount = 5
End Sub
Sub AttendenceWeeks()
WeekCounter = 0
myNum = 1
Do
EmployeeNumber
If DayCount = 5 Then
WeekCounter = WeekCounter + 1
Loop Until WeekCounter = 13
End Sub
How far off base am I? Thanks in advance if anyone answers this one.
Private Procedure
Dim dbs As Database
Dim rst As Recordset
Dim EmploeeNumber As String
Dim DateWeekStarting As Date
Dim WorkDay1Reason As String
Dim WorkDay2Reason As String
Dim WorkDay3Reason As String
Dim WorkDay4Reason As String
Dim WorkDay5Reason As String
Dim strSQL
Set dbs = CurrentDb
Sub AttendenceDays()
DayCounter = 0
Do
If WorkDay1Reason = " " Or WorkDay1Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay2Reason = " " Or WorkDay2Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay3Reason = " " Or WorkDay3Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay4Reason = " " Or WorkDay4Reason = "HolD-A" Then
DayCounter = DayCounter + 1
If WorkDay5Reason = " " Or WorkDay5Reason = "HolD-A" Then
DayCounter = DayCounter + 1
Loop Until DayCount = 5
End Sub
Sub AttendenceWeeks()
WeekCounter = 0
myNum = 1
Do
EmployeeNumber
If DayCount = 5 Then
WeekCounter = WeekCounter + 1
Loop Until WeekCounter = 13
End Sub
How far off base am I? Thanks in advance if anyone answers this one.