Null RecordSource Problem
- From: "Jeff via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 16 May 2005 16:01:14 GMT
I have a search button on my form that sets the recordsource to a new
recordset based on the search criteria. My problem is that if the search
returns no records then I get an error message. To get around this I'll
have to check if the recordset is null before I set it. Unfortunately, I
can't seem to get it working. Here's the code that works without null
recorsets. Can someone help me insert the null check into this code.
Thanks,
Dim IDCheck, SQLString AS String
IDCheck = InputBox("Please enter the Case ID you wish to search for.",
"Search", "")
If IDCheck = "" Then
'No value entered or cancel was clicked
Exit Sub
Else
'Search for ID
SQLString = "SELECT * FROM Table WHERE [ID] = "& IDCheck
Me.RecordSource = SQLString
End If
--
Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: Null RecordSource Problem
- From: Philipp Stiefel
- Re: Null RecordSource Problem
- From: Jeff via AccessMonster.com
- Re: Null RecordSource Problem
- From: Sylvain Lafontaine
- Re: Null RecordSource Problem
- Prev by Date: test
- Next by Date: Re: Null RecordSource Problem
- Previous by thread: test
- Next by thread: Re: Null RecordSource Problem
- Index(es):