Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box Instead of Combo

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

I have a table of Item Master which consist of the following fields:

1. Item Code c(10)
2. Barcode c(13)
3. Description c(72)

And, the first 9 characters of barcode start with '506006855' and rest four are unique no. What I want is if I type on text box like 50.. it should fill automatically by the aforementioned code and on pressing enter cursor should jump to tenth position so that I can type the remaining four digit in order to search the Item by barcode.

Thanks

Saif
 
the first 9 characters of barcode start with '506006855'

Do you mean that the first 9 characters are always '506006855'?

If so, there's no point in filling them in. Just get the user to type the last four digits.

If the first 9 characters are not always '506006855', then the user needs to enter more than '50'.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
In short you talk about autocomplete. I'd perhaps rather display 506006855 on a label and add a textbox for the last 4 digits.

Bye, Olaf.
 
No, it is not always same as 506006855, we have different barcodes like;

1 226390604
2 354620000
3 502751333
4 506006855
5 692874505
6 803266559
7 869000012
8 869146311
9 869234512
10 869234567
11 869740560
12 869775569
13 881451818
14 882541841
15 885266060

Please guide..

Saif
 
I'd still have a seperate textbox for the final four digits. Ynd you may use wither a combobox with incrementalsearch=.t., or a textbox with autocomplete feature for the 15 barcode prefixes.

Bye, Olaf.
 
Yes, I agree. I would have two separate textboxes: one for the first nine digits, and the other for the remaining four.

In the first textbox, set the AutoComplete property to 1. In the other textbox, leave it at its default value.

That way, the user will only have to type the first few digits in the first box, but will still have to type all four in the second one. That's much better than automatically entereing the first nine and then positioning the insertion point (as you first suggested), because with that approach, the user has to look at the control the whole time in order to do it right, and it would be too easy for them to get it wrong.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Actually I want to avoid combo box, which I already did it. I want the same in a single text box, but no problem I can generate two boxes text1 and text2 but the question arise how can I popup above mentioned barcode from icode.dbf in text1?

Thanks

Saif
 
Well, the solution with only one textbox would not be impossible, but even I would need to think about it, the outcome would be something complicated with code in interactivechange, I wouldnt go that route.

The autocomplete feature allows you to add your own autocomplete table, to allow adding to it or not, and much more. Just search autocomplete in the help, I can't explain it better as it's already described there.

Bye, Olaf.
 
how can I popup above mentioned barcode from icode.dbf in text1?

You don't really have to do anything. Just set the AutoComplete property, as I mentioned above.

The first few times a user enters a code in text1, they will have to enter it in full. But, once they've done that, the textbox will remember their entries, and pop them up in future.

The nice thing about this system is that you won't have to change anything when new codes come along. The textbox will automatically "learn" them.

If it's not clear how it works, just try it and see.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks for the reply, I don't want to remember the entries by text box, I want the records from the icode.dbf. In your suggestion what I understood is it will show only those record(s) which is entered, but here I want the (15) records which is already in the table though we entered it or not.

Thanks

Saif

 
Read about autocomplete, please. You can also specify an autocomplete table. If you refuse to read, you will never get there.
Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top