June7
AWF VIP
- Local time
- Today, 13:17
- Joined
- Mar 9, 2014
- Messages
- 5,470
Removing sorting and grouping from report eliminates error so something about data in those fields.
Why are you saving names and call sign into DutyControl table? This is duplicating data between tables. Why do some names have duplicate records in LEO table? Why do some records not have CallSign value?
Letter case is not relevant in DateAdd or other functions.
There is no Permission table therefore code errors on UserAccess function.
Recommend radio buttons instead of checkboxes within an Option Group frame and use Click event procedure of frame. Reduces code.
Why are you saving names and call sign into DutyControl table? This is duplicating data between tables. Why do some names have duplicate records in LEO table? Why do some records not have CallSign value?
Letter case is not relevant in DateAdd or other functions.
There is no Permission table therefore code errors on UserAccess function.
Recommend radio buttons instead of checkboxes within an Option Group frame and use Click event procedure of frame. Reduces code.
Code:
'Check values are entered into Date From and Date To text boxes
'if so run report or cancel request
If Len(Me.StartDate & vbNullString) = 0 Or _
Len(Me.EndDate & vbNullString) = 0 Then
MsgBox "Please ensure that a report date range " & _
"is entered into the form", _
vbCritical, "View By Date"
Exit Sub
Else
Select Case Me.Frame57
Case 1
stDocName = "LeoByDate"
Case 2
stDocName = "VehiclesByDate"
Case 3
stDocName = "PassengersByDate"
End Select
DoCmd.OpenReport stDocName, acViewReport
'Globals.Logging "Viewing a report", "View Report", stDocName & " " & Me.StartDate & " " & Me.EndDate & ""
Me.Visible = False
End If
Code:
Private Sub Frame57_Click()
Me.StartDate.Enabled = True
Me.EndDate.Enabled = True
Me.btnClear.Enabled = True
Me.btnL7Days.Enabled = True
Me.btnMonth.Enabled = True
Me.btnToday.Enabled = True
Me.btnView.Enabled = True
Me.btnYesterday.Enabled = True
End Sub
Code:
Private Sub NewRec()
Me.Frame57 = Null
Me.StartDate = ""
Me.StartDate.Enabled = False
Me.EndDate = ""
Me.EndDate.Enabled = False
Me.btnClear.Enabled = False
Me.btnClear.Visible = True
Me.btnL7Days.Enabled = False
Me.btnMonth.Enabled = False
Me.btnToday.Enabled = False
Me.btnView.Enabled = False
Me.btnView.Visible = True
Me.btnYesterday.Enabled = False
End Sub
Last edited: