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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating a barcode number in the table and form

Status
Not open for further replies.

RTKarkivi

Technical User
Jun 28, 2003
22
Hello,


I have a form based on the table with these fields:
1. Fixed asset number (ex. 354)
2. Asset category (three characters, ex.107)
3. Location of the asset (two options: Television or Radio)
4. Origin of the asset (two options: Donation or Investment)
5. Barcode number



What I want, is automatic generating a 10 character barcode number consisting of the following data:
- First character of the location (ex. “T” for Television, and “R” for Radio)
- Three characters of the asset category (ex. 107)
- First character of the origin (ex. “D” for Donation and “I” for Investment)
- Five characters from the Asset Number (ex. 00354 for 354)



I count on your support.


Thanks,
Hysen
 
Something like this ?
[Barcode number] = Left([location],1) & [asset category] & Left([origin],1) & Format([Asset Number],"00000")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV,

that helped me, but partially, as in my form I have just a asset category ID item and that appears in my barcode text box and not the three character asset category description.

I have another question, how is this possible to be done in access tables as well. Because when I open the table for viewing the data, the barcode number field is blank.

Could anybody help me on this?


regards,

Hysen
 
HI

If the bar code number is built up from other data in the table why store it?, you are breaking the rules of good database design, instead use a query to act on the table data, and include a calculated column as PHV outlined

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hello,

I fixed that as you proposed me. The problem now is that I want to create a report based on this barcode number. How could I do that?


regards,

Hysen
 
Either calculate the barcode in the underlaying query or in the ControlSource property of the textbox.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top