J
jo
Hi guys I have VBA to open Access, generate a report then to email works
perfect. Then the user requested a Password to protect the program so when
you open the program the switchboard is on view then the user will click on a
button to open a form and at that point the user will be requested to enter a
password which works fine for the user but my problem is how do I add this
part to my code which will generates automatically via a Schedule task. This
is the first part of my code to create the report how do add the code to
automatically enter the Password?
'------------------------------------------------------------
' checker_Query_overdue
'
'------------------------------------------------------------
Function checker_Query_overdue()
On Error GoTo checker_Query_overdue_Err
If (DCount("*", "OnOpenOverdue") > 0) Then
DoCmd.OpenReport "OnOpenOverdue", acPreview
DoCmd.OutputTo _
acOutputReport, , acFormatSNP, _
Application.CurrentProject.Path & "\Overdue.snp", False
DoCmd.Close acReport, "OnOpenOverdue", acSaveNo
Call SendNotesMail("Roller Patterns", _
Application.CurrentProject.Path & "\Overdue.snp", _
"RollerPattern", "Roller Patterns Overdue", False)
DoCmd.Close acReport, "Overdue.snp", acSaveNo
Else
Exit Function
End If
Application.Quit
checker_Query_overdue_Exit:
Exit Function
checker_Query_overdue_Err:
MsgBox Error$
Resume checker_Query_overdue_Exit
perfect. Then the user requested a Password to protect the program so when
you open the program the switchboard is on view then the user will click on a
button to open a form and at that point the user will be requested to enter a
password which works fine for the user but my problem is how do I add this
part to my code which will generates automatically via a Schedule task. This
is the first part of my code to create the report how do add the code to
automatically enter the Password?
'------------------------------------------------------------
' checker_Query_overdue
'
'------------------------------------------------------------
Function checker_Query_overdue()
On Error GoTo checker_Query_overdue_Err
If (DCount("*", "OnOpenOverdue") > 0) Then
DoCmd.OpenReport "OnOpenOverdue", acPreview
DoCmd.OutputTo _
acOutputReport, , acFormatSNP, _
Application.CurrentProject.Path & "\Overdue.snp", False
DoCmd.Close acReport, "OnOpenOverdue", acSaveNo
Call SendNotesMail("Roller Patterns", _
Application.CurrentProject.Path & "\Overdue.snp", _
"RollerPattern", "Roller Patterns Overdue", False)
DoCmd.Close acReport, "Overdue.snp", acSaveNo
Else
Exit Function
End If
Application.Quit
checker_Query_overdue_Exit:
Exit Function
checker_Query_overdue_Err:
MsgBox Error$
Resume checker_Query_overdue_Exit