R
Ryis
Hello,
I have a button which opens a module to a specific function as the following
DoCmd.OpenModule "ReportFunctions", Me!MODULE
Me!MODULE= a column in a table example "opencpar"
The module opens but in VB to the specific point, I want the module to run
the code..here is the code:
Private Sub opencpar()
On Error GoTo Err_opencpar
Dim stDocName As String
Dim stLinkLocation As String
stDocName = Forms![MAIN MENU]![TYPE OF REPORT]
stLinkLocation = "[LOCATION]=" & "'" & Forms![MAIN MENU]![REPORT
LOCATION] & "'"
If Forms![MAIN MENU]![REPORT LOCATION] <> "ALL" Then
DoCmd.OpenReport stDocName, acViewPreview, , stLinkLocation
End If
If Forms![MAIN MENU]![REPORT LOCATION] = "ALL" Then
DoCmd.OpenReport stDocName, acViewPreview
End If
Exit Sub
Exit_opencpar:
Exit Sub
Err_opencpar:
MsgBox "There are no Records Available"
Resume Exit_opencpar
End Sub
I have a button which opens a module to a specific function as the following
DoCmd.OpenModule "ReportFunctions", Me!MODULE
Me!MODULE= a column in a table example "opencpar"
The module opens but in VB to the specific point, I want the module to run
the code..here is the code:
Private Sub opencpar()
On Error GoTo Err_opencpar
Dim stDocName As String
Dim stLinkLocation As String
stDocName = Forms![MAIN MENU]![TYPE OF REPORT]
stLinkLocation = "[LOCATION]=" & "'" & Forms![MAIN MENU]![REPORT
LOCATION] & "'"
If Forms![MAIN MENU]![REPORT LOCATION] <> "ALL" Then
DoCmd.OpenReport stDocName, acViewPreview, , stLinkLocation
End If
If Forms![MAIN MENU]![REPORT LOCATION] = "ALL" Then
DoCmd.OpenReport stDocName, acViewPreview
End If
Exit Sub
Exit_opencpar:
Exit Sub
Err_opencpar:
MsgBox "There are no Records Available"
Resume Exit_opencpar
End Sub