G
Guest
I have a code that is not processing correctly. Can someone look at it to
see what I am missing. I have never done this kind of statement before.
Private Sub CmdSearch_Click()
Dim stDocNameSearch As String
Dim VarSo As Variant
Dim VarRMA As Variant
Dim VarAccNum As Variant
Dim VarPart As Variant
Dim VarSN As Variant
Dim VarLot As Variant
VarSo = Me!CmboSO
VarRMA = Me!CmboRMA
VarAccNum = Me!CmboAccNum
VarPart = Me!CmboPart
VarSN = Me!CmboSN
VarLot = Me!CmboLot
stDocNameSO = "RMARequestSO"
stDocNameRMA = "RMARequestRMA"
stDocNameAccNum = "RMARequestAccNum"
stDocNamePart = "RMARequestPart"
stDocNameSN = "RMARequestSN"
stDocNameLot = "RMARequestLot"
If VarSo <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarRMA <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarAccNum <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarPart <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarSN <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarLot <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
End Sub
see what I am missing. I have never done this kind of statement before.
Private Sub CmdSearch_Click()
Dim stDocNameSearch As String
Dim VarSo As Variant
Dim VarRMA As Variant
Dim VarAccNum As Variant
Dim VarPart As Variant
Dim VarSN As Variant
Dim VarLot As Variant
VarSo = Me!CmboSO
VarRMA = Me!CmboRMA
VarAccNum = Me!CmboAccNum
VarPart = Me!CmboPart
VarSN = Me!CmboSN
VarLot = Me!CmboLot
stDocNameSO = "RMARequestSO"
stDocNameRMA = "RMARequestRMA"
stDocNameAccNum = "RMARequestAccNum"
stDocNamePart = "RMARequestPart"
stDocNameSN = "RMARequestSN"
stDocNameLot = "RMARequestLot"
If VarSo <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarRMA <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarAccNum <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarPart <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarSN <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
If VarLot <> "" Then
DoCmd.OpenReport stDocNameSO, acViewPreview
Else
End Sub