G
Guest
I have a switchboard that has several combo boxes on used to filter a report
I want to open. I can't seam to get it to work. Can someone please look at
the string to find out what I am missing.
Private Sub CmdSearch_Click()
Dim stDocNameSearch As String
'Creating a Variant
Dim VarSo As Variant
Dim VarRMA As Variant
Dim VarAccNum As Variant
Dim VarPart As Variant
Dim VarSN As Variant
Dim VarLot As Variant
'Defining the Variant and what combox it is for
VarSo = Me!CmboSO
VarRMA = Me!CmboRMA
VarAccNum = Me!CmboAccNum
VarPart = Me!CmboPart
VarSN = Me!CmboSN
VarLot = Me!CmboLot
'all the reports names
stDocNameSO = "RMARequestSO"
stDocNameRMA = "RMARequestRMA"
stDocNameAccNum = "RMARequestAccNum"
stDocNamePart = "RMARequestPart"
stDocNameSN = "RMARequestSN"
stDocNameLot = "RMARequestLot"
'used to open the reports with a else if statment
If VarSo <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarRMA <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarAccNum <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarPart <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarSN <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarLot <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
Else
End If
When I run the quiers they run fine. But when I run the reports the first
on only opens up correctly. The reset do not. If anyone has a better way
even it it is not a report maybe a form that would be great.
I want to open. I can't seam to get it to work. Can someone please look at
the string to find out what I am missing.
Private Sub CmdSearch_Click()
Dim stDocNameSearch As String
'Creating a Variant
Dim VarSo As Variant
Dim VarRMA As Variant
Dim VarAccNum As Variant
Dim VarPart As Variant
Dim VarSN As Variant
Dim VarLot As Variant
'Defining the Variant and what combox it is for
VarSo = Me!CmboSO
VarRMA = Me!CmboRMA
VarAccNum = Me!CmboAccNum
VarPart = Me!CmboPart
VarSN = Me!CmboSN
VarLot = Me!CmboLot
'all the reports names
stDocNameSO = "RMARequestSO"
stDocNameRMA = "RMARequestRMA"
stDocNameAccNum = "RMARequestAccNum"
stDocNamePart = "RMARequestPart"
stDocNameSN = "RMARequestSN"
stDocNameLot = "RMARequestLot"
'used to open the reports with a else if statment
If VarSo <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarRMA <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarAccNum <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarPart <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarSN <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
ElseIf VarLot <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
'End If
Else
End If
When I run the quiers they run fine. But when I run the reports the first
on only opens up correctly. The reset do not. If anyone has a better way
even it it is not a report maybe a form that would be great.