Data Type Mismatch in Dynamic Query

nobbie1

Registered User.
Local time
Today, 16:04
Joined
Aug 13, 2003
Messages
25
Hello all,

Attached is a test version of my database. I'm trying to create a form which can search through my one table dynamically. Everything works great except for when I try to search by the Tech ID. I get a data type mismatch error.

The form which I'm testing is the Test Form. The code I'm using I got from the microsoft site here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;210242

I'm pretty sure it's something simple I've overlooked.
 

Attachments

Without looking at your attachment, you've probably got a delimiter wrong surrounding a referred value within a literal string.

ie..

when getting a numeric value:

MyString = "MyField = " & Me.txtNumber & " AND ....."

when getting a text value:

MyString = "MyField = """ & Me.txtText & """ AND ....."

when getting a date value:

MyString = "MyField = #" & Me.txtDate & "# AND ....."
 
Without looking at your attachment, you've probably got a delimiter wrong surrounding a referred value within a literal string.

That was one of the first things I had checked before posting for help. I've actually have the code checking a combo box which the bound column should be a numeric field.

I'm still scratching my head over this one.

Thanks
 
nobbie1 said:
I'm still scratching my head over this one.

Hm. What version of Access? I've downloaded it and ran it... every button off the forms except the main switchboard result in an error for me.
 
sorry for not replying earlier.

I played around with it some more and the test form I have in there I just changed the tech ID to look for the last name and based the search off that.
 

Users who are viewing this thread

Back
Top Bottom