Search Form behaviour problem

razorking

Registered User.
Local time
Today, 00:22
Joined
Aug 27, 2004
Messages
332
Hello,

I am hoping someone might be so kind as to help me with a search form I am working on. I have included a test database that has the form. The form has a search box that works dynamically to show results based upon a string search as typed into the search box. The problem is: if I type any spaces beyond the last digit of what I am searching for it no longer displays the intended result.

For example; there is a field called - serial - in the test databse you will see a value in that field of 319-04. If I type 319-04 it shows that record only. However if I key in any additional spaces after the 319-04 it will not show the result.

This is just a problem because I am trying to input the data using a scanner. I have found that if I scan the barcode with the serial# it seems to include two spaces after the scan. I don't know why that is...but rather than worry about that I would just like to try and get the form to display the record even if there are spaces after the last digit entered.

Thanks!
 

Attachments

Last edited:
It appears you have a problem with trailing spaces.
Try trimming it out using the Trim function.
 
edtab said:
It appears you have a problem with trailing spaces.
Try trimming it out using the Trim function.

Well...I will try when I get back to work tomorrow...no scanner at home. However, I'm not sure the trim funcion is the answer. It seems to me like it would have something to do with the vSearchString code behind the text box on the search form. I did not create the code I just found it somewhere and incorporated it into my database, so I do not fully understand how it works.

Question:
Why is it that if I create a regular parameter query and have the query prompt for a value to be entered on the serial field, it will return the 319-04 record even if I enter spaces after entering the serial, but the search form will not?

I need to understand why after keying the 319-04 it displays, but if I then press the tab on the keyboard it goes away. What is the logic being used?

Thanks!
 
Well I guess I will have to have to go to plan B on this. There does not appear to be an answer to why the search function does not show results after pressing the the space bar one or more times.

If anyone can explain to me why this thing does not work I would appreciate it.
 

Users who are viewing this thread

Back
Top Bottom