robbydogg
Registered User.
- Local time
- Today, 12:38
- Joined
- Jul 15, 2008
- Messages
- 56
Hello,
I am using the below VB code to try and send a load of values from one form to another, but only if they are not nul. I run the code and it states "
Compile Error: Else without IF and highlights the first occurance of the Else statement.
Any help would be much appreciated
Private Sub Command320_Click()
On Error Resume Next
If Me.SrchID.Value > "" Then Forms!Frm_main!SrchID.Value = SrchID.Value
Else
Forms!Frm_main!SrchID.Value = "*"
End If
If SrchPR.Value > "" Then Forms!Frm_main!SrchPR.Value = SrchPR.Value
Else
Forms!Frm_main!SrchPR.Value = "*"
End If
If SrchLC.Value > "" Then Forms!Frm_main!SrchLC.Value = SrchLC.Value
Else
Forms!Frm_main!SrchLC.Value = "*"
End If
If SrchBR.Value > "" Then Forms!Frm_main!SrchBR.Value = SrchBR.Value
Else
Forms!Frm_main!SrchBR.Value = "*"
End If
If SrchCT.Value > "" Then Forms!Frm_main!SrchCT.Value = SrchCT.Value
Else
Forms!Frm_main!SrchCT.Value = "*"
End If
If SrchOC.Value > "" Then Forms!Frm_main!SrchOC.Value = SrchOC.Value
Else
Forms!Frm_main!SrchOC.Value = "*"
End If
If SrchDC.Value > "" Then Forms!Frm_main!SrchDC.Value = SrchDC.Value
Else
Forms!Frm_main!SrchDC.Value = "*"
End If
If SrchTR.Value > "" Then Forms!Frm_main!SrchTR.Value = SrchTR.Value
Else
Forms!Frm_main!SrchTR.Value = "*"
End If
End Sub
Kind thanks.
I am using the below VB code to try and send a load of values from one form to another, but only if they are not nul. I run the code and it states "
Compile Error: Else without IF and highlights the first occurance of the Else statement.
Any help would be much appreciated
Private Sub Command320_Click()
On Error Resume Next
If Me.SrchID.Value > "" Then Forms!Frm_main!SrchID.Value = SrchID.Value
Else
Forms!Frm_main!SrchID.Value = "*"
End If
If SrchPR.Value > "" Then Forms!Frm_main!SrchPR.Value = SrchPR.Value
Else
Forms!Frm_main!SrchPR.Value = "*"
End If
If SrchLC.Value > "" Then Forms!Frm_main!SrchLC.Value = SrchLC.Value
Else
Forms!Frm_main!SrchLC.Value = "*"
End If
If SrchBR.Value > "" Then Forms!Frm_main!SrchBR.Value = SrchBR.Value
Else
Forms!Frm_main!SrchBR.Value = "*"
End If
If SrchCT.Value > "" Then Forms!Frm_main!SrchCT.Value = SrchCT.Value
Else
Forms!Frm_main!SrchCT.Value = "*"
End If
If SrchOC.Value > "" Then Forms!Frm_main!SrchOC.Value = SrchOC.Value
Else
Forms!Frm_main!SrchOC.Value = "*"
End If
If SrchDC.Value > "" Then Forms!Frm_main!SrchDC.Value = SrchDC.Value
Else
Forms!Frm_main!SrchDC.Value = "*"
End If
If SrchTR.Value > "" Then Forms!Frm_main!SrchTR.Value = SrchTR.Value
Else
Forms!Frm_main!SrchTR.Value = "*"
End If
End Sub
Kind thanks.