Sharkiness
Registered User.
- Local time
- Today, 05:07
- Joined
- Sep 25, 2008
- Messages
- 31
Hi Guys,
I pinched some code from another thread but I thought I would start a new one as the other thread was quite old.
The problem I am having is that the message appears even if one of the textboxes have an entry. I want the message to flag only if all textboxes are incomplete.
If i enter a value in a textbox that i know exists, the results appear, and the message box but then the disappear due to the code
the reason i have this is that if someone searches for results they appear, but then if they clear the boxes i want the rowsource to be empty with the message flagging.
Otherwise the lstresults populates with all records as I have a few 'Like' search parameters in the code 'Listsearchresults'.
I dont want these like results to show as people should have access to records without a need to search on them.
Any help would be great.
I pinched some code from another thread but I thought I would start a new one as the other thread was quite old.
Code:
For Each ctl In Me.Detail.Controls
If ctl.ControlType = acTextBox Then
If IsNull(ctl.Value) Then
MsgBox "No information has been provided", vbOKOnly
Me.lstResults.RowSource = ""
Exit Sub
Else
ListSearchresults
End If
End If
Next ctl
The problem I am having is that the message appears even if one of the textboxes have an entry. I want the message to flag only if all textboxes are incomplete.
If i enter a value in a textbox that i know exists, the results appear, and the message box but then the disappear due to the code
Code:
me.lstresults.rowsource=""
the reason i have this is that if someone searches for results they appear, but then if they clear the boxes i want the rowsource to be empty with the message flagging.
Otherwise the lstresults populates with all records as I have a few 'Like' search parameters in the code 'Listsearchresults'.
I dont want these like results to show as people should have access to records without a need to search on them.
Any help would be great.