View Single Post
  #6  
Old April 29th, 2010, 03:00 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Search form with a checkbox.

Joseluis -

The True is the same as -1 (False is 0), so don't worry about that.

Try this:
Debug.Print ("SELECT tblContacts.* FROM tblContacts
WHERE " & varWhere)

Another thought on your syntax. As to the CurrentDB - I always used that as
a function to return the current database to a database variable. You may
want to include this:

dim db1 As Database
Set db1 = CurrentDB()

Then in your recordset statement, use db1 instead of CurrentDB.

Try those two things and let us know what you get.

--
Daryl S


"JOSELUIS via AccessMonster.com" wrote:

Sorry because I misunderstood you before. I add the debug.print and this is
what is displayed in the inmediate window:
(Residents = True)
I´ve tried to change chkResidents= -1 but I haven´t solved the problem. Any
suggestions?
Daryl S wrote:
Joseluis -

OK, you won't have a leading AND unless Me.cmbEmpleo is empty.

Add the debug.print varWhere as I mentioned before - right before the Set
rst statement. Step through it and post what is displayed on that step in
the immediate window. You may spot the issue from that yourself. Otherwise
post it and we can help spot the issue.

Thank you Daryl S for your time , the code os the fdlgSearch is as following:

[quoted text clipped - 141 lines]
Whenever I tryed to execute the search an Error # 3061#is displayed and
the code is interrupted in this line.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

.