RunTime Error 3075

rat_b76

Registered User.
Local time
Today, 11:19
Joined
May 20, 2003
Messages
37
Hi All,

Just a quick thanks to all that respond to my queries, as this forum is fantastic.

I have a question, I have a database which does some searching through sql. I have linked this to show the results in a List Box with matching returns based on the query.

The problem I have found is when I get the initial results and either click on a blank area within the table or the headings it returns the Runtime error, it has to do with not being able to return a result as no record was clicked on.

Code:
DoCmd.OpenForm "Data", , , "[Record] = " & Me.lstCustInfo, , acDialog

I have tried entering an If statement before hand asking that if Me.lstCustInfo.value=Null then exit sub, however, it seems to just skip over it.

Any help would be much appreciated.

Cheers & Beers
Rat_b76
 
The syntax your looking for is:

if isnull(Me.lstCustInfo) then exit sub

.value is the default, so there is no need for that...

Regards

The Mailman
 
Thanks

Thanks for the response worked terrificaly.

Cheers & Beers
 

Users who are viewing this thread

Back
Top Bottom