G
Guest
I have a textbox [textbox] and i have a search button. I want it to be able to come up with an error message when nothing is entered in the textbax. From what i can remember i think the script goes along the lines of
if [textbox] = " " the
msgbox "You need to enter a value
else: (and it would continue with the rest
and before end sub i would put End if
Only prob is the form runs as if the if statement isn't there. I'll copy the statement for belo
--
Private Sub Command37_Click(
On Error GoTo Err_Command37_Clic
Dim stDocName As Strin
Dim stLinkCriteria As Strin
If "[Text35]=" & "'" The
MsgBox "You need to enter a name
DoCmd.Clos
Else
stDocName = "Details
stLinkCriteria = "[Surname]=" & "'" & Me![Text35] & "'
DoCmd.OpenForm stDocName, , , stLinkCriteri
Exit_Command37_Click
Exit Su
End I
Err_Command37_Click
MsgBox Err.Descriptio
Resume Exit_Command37_Clic
End Su
I just don't know what to do with this one. Any help will be very appreciate
if [textbox] = " " the
msgbox "You need to enter a value
else: (and it would continue with the rest
and before end sub i would put End if
Only prob is the form runs as if the if statement isn't there. I'll copy the statement for belo
--
Private Sub Command37_Click(
On Error GoTo Err_Command37_Clic
Dim stDocName As Strin
Dim stLinkCriteria As Strin
If "[Text35]=" & "'" The
MsgBox "You need to enter a name
DoCmd.Clos
Else
stDocName = "Details
stLinkCriteria = "[Surname]=" & "'" & Me![Text35] & "'
DoCmd.OpenForm stDocName, , , stLinkCriteri
Exit_Command37_Click
Exit Su
End I
Err_Command37_Click
MsgBox Err.Descriptio
Resume Exit_Command37_Clic
End Su
I just don't know what to do with this one. Any help will be very appreciate