There is a button on the form that displays all the records in the form. I have to provide an overview of what the code does so unsure how to explain it in layman terms so a non-technical person understands it. Can anyone help?
Private Sub ShowAll_cmd_Click()
' Change the forms Record Source query to show all records
' unhide the Print Prieview button
' Objects
Dim oForm As Form ' form
Dim oCtrl As CommandButton ' control
' Strings and things
Dim sSQl As String ' new query for Record Source
On Error GoTo Err_ShowAll_cmd_Click ' establish error handling
Set oForm = Forms![COL Form] ' set form object
' write a new sql statment for the forms Record Source
sSQl = "SELECT * FROM [qryCOLmr] ORDER BY [num];"
oForm.RecordSource = sSQl ' replace the Record Source
' unhide the Print Prieview button
Set oCtrl = oForm![Print_cmd]
oCtrl.Visible = True
Exit_ShowAll_cmd_Click:
Set oCtrl = Nothing ' close object
Set oForm = Nothing ' close object
Exit Sub
Private Sub ShowAll_cmd_Click()
' Change the forms Record Source query to show all records
' unhide the Print Prieview button
' Objects
Dim oForm As Form ' form
Dim oCtrl As CommandButton ' control
' Strings and things
Dim sSQl As String ' new query for Record Source
On Error GoTo Err_ShowAll_cmd_Click ' establish error handling
Set oForm = Forms![COL Form] ' set form object
' write a new sql statment for the forms Record Source
sSQl = "SELECT * FROM [qryCOLmr] ORDER BY [num];"
oForm.RecordSource = sSQl ' replace the Record Source
' unhide the Print Prieview button
Set oCtrl = oForm![Print_cmd]
oCtrl.Visible = True
Exit_ShowAll_cmd_Click:
Set oCtrl = Nothing ' close object
Set oForm = Nothing ' close object
Exit Sub