insert criteria but no output

Jim8541

Registered User.
Local time
Today, 05:19
Joined
Aug 13, 2004
Messages
14
Hello, When I type in criteria into the criteria field in the QBE the query doesn't return any data. Here's my set up. I have one(1) record in the table

tblIndex
field 1 = pk
field 2= TicketNum.......... = A220074
field 3= IndexNumber....... = 2
In my query I selected TicketNum and IndexNumber. If I run the query I get the one record that's in the table. If I place A220074 in the criteria field of TicketNum, the query doesn't return anything. I can't figure this out. Any ideas on what's going on here?
thanks Jim
 
Jim,

Are you by any chance using a "mask" to put the "A" in front of the
ticket number? If so, the underlying field is really a number.

Wayne
 
Hi Wayne, no I'm not using a mask. But, here's what I found. I'm using this code to write to my table.
Code:
 CurrentDb.Execute ("INSERT INTO tblIndex(ticketNum, IndexNumber)" & _
        "select ' " & ThisMemberTicketNum & " ', " & NextIndexNum & " ")

There is a leading empty space when the code gets written to my table. When I typed a value directly into the table(for testing) or moved the data to the left one space it works fine. Any ideas why I would get a leading empty space?
Thanks, Jim
 
Wayne, I removed the space between the single quote and the double quotes after the select and before the variable and it seems to be working fine. That only took me about 3 hours. :) :)
 

Users who are viewing this thread

Back
Top Bottom