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

Auto fill a field from the previous record

Status
Not open for further replies.

rlmorgan

Technical User
Jun 2, 2006
32
US
I have a data entry form that I am trying to create that will inventory the contents of shelf locations using a hand scanner. I would like to scan the shelf location tag once, and then all items located on that shelf. Then scan the next shelf tag and it's contents and so on.

My question is, how can I get the scanned shelf tag to carry over to the next record without having to rescan it every time for each record?
 
I apologize, this thread should have been put in the Access Forms Forum.

Thanks for the quick response Leslie. To answer your question, the form I am trying to get to work puts it's data in a table called tbl_BackShopCount that has two fields, AssetTag and LCode. The AssetTag is the Item on the shelf and the LCode is the Shelf location.
 
ok, but the question was: is there something that, when the user scans the "shelf" tag that indicates it's a shelf, like a standard format of

SHELF_##

and then the item tags are different, ITEM_##

in other words, can you tell when a SHELF is scanned?
 
No, but if it would make it easier, I can change the scan bars on the shelf. What I have tried is using the mouse to change the input field. If there is a way for Access to know the difference without manual intervention, that would be great.
 
well, sure, if you have a bar code on the shelf that is:

SHELF#

and then each time the scanner reads a barcode you check to see if it's a shelf, if it is, then update the value that's storing the current shelf number if it's not a shelf use the existing shelf value.

In psuedo code:

lastShelf = ""
If scannedvalue contains "SHELF" then
lastShelf = scannedvalue
else (scannedvalue is an item)
input itemnumber with existing lastShelf value



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Sorry, I’m a little new to this. Where do I put the code in the form? Do I need two input fields or just the “scannedvalue” field that will update the table as needed?
 
a barcode reader is just like typing those values. I would have a control on my form that captures whatever I just scanned and then in that control, check the scanned value with some code to see if you've just scanned a shelf or an item.
 
Thanks for the help on this. I give it a try and see if I can make it work...
 
Nuts… Ok, I guess I’m not as knowledgeable as I thought. I can’t figure out how to make this work. I understand that the scanner will input text just like you were typing it. Do I create an un-bound text box for the “scannedvalue” and if so were do I put the code? Properties, Event, OnEnter? Would this be an Expression, Macro or Code?
 
I don't really do much with Access forms, so I'm not really sure which event will be appropriate. I'm sure someone in that Forum can point you in the right direction.

Yes, it will need to be an unbound text box and then in the appropriate event, check to see if it's a different Shelf value than the one you are currently using, if so change it, if not use what you've got!

Good luck!
Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top