If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > FileMaker > How to capture data and auto-create a blank record?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Dec 2002
Location: Olympia, WA
Posts: 1
How to capture data and auto-create a blank record?

This is giving me a royal brain hernia...

We're planning to take inventory in our college library using barcode scanners. What I want to do is scan alphanumeric-based barcodes (M#####) one-at-a-time into a single field (named barcode), and have FM auto-create a new record after each barcode is scanned. (Note: the scanners are set up so they automatically append a carriage return after each barcode number.) So, what would ideally happen is I'd scan a barcode, FM records it and creates a new, blank record; scan a barcode, FM records it and creates a new, blank record, ad infinitum. We'll probably end up with around 10,000-15,000 records.

I know it involves a loop function but I can't figure out how to key it so that when FM "sees" the carriage return it knows to create a new, blank record.

Any ideas before the last few strands of my hair turns gray or falls out?

Ciao, and thanks!

Rich
South Puget Sound Community College in
lush, exotic, tropical Olympia, WA
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Dec 2002
Location: Lisbon
Posts: 9
Post Re: How to capture data and auto-create a blank record?

Hi Rich,


A good ideia would be to do it all in batches instead of just one book at a time.

I've never worked with FM and barscanning together but if you manage to create a single FM, return delimited text, file with a bunch of your barcodes you are in business. Actually this script will also work with one record at a time. But you should grab a list of books, or make one as you go along, so you can capture loads of barcodes (and still know which book each barcode references ).

So considering you have all the barcodes in a single FM field in an out of system PARENT file, like this:

Barcode1
barcode2
...
barccoden

All you have to do is create a CHILD file and a relation from Parent->to->Child, with Allow creation of related records Set On.
This relation can be based on an simple field (with a constant in it) or a calculation.

Relation
k =:: k

You need these fields in Parent:

k(calculation=1)
gWordCount(Global, Number)
gLeftAllBarcodesCount(Global, Number)
YourRecordWithAllBarcodes(Text)

Put these fields in the Child File:
k(Text)
OneBarcodeRecord(Text)

Know it's easy:

Go back to Parent make a Portal to Child on the Portal put the child field OneBarcodeRecord.

\\--------------
Create the following script in Parent: "CreatChildBarcodes"

Go to Layout [with Portal]
Set Field[gWordCount, WordCount(YourRecordWithAllBarcodes)]
Set Field[gLeftAllBarcodesCount, "1"]
Loop
Go to Portal Row[Last]
Set Field[Relation::OneBarcodeRecord, MiddleWords(YourRecordWithOneFieldWithAllBarcodes; gLeftBarCodeCount; 1)
Set Field[gLeftAllBarcodesCount, gLeftAllBarcodesCount + 1]
Exit Loop If[gLeftAllBarcodesCount = gWordCount + 1]
End Loop
Go to Layout[original layout]

\\--------------

Don't Forget:
The Relation must Allow creation of records
The Script must run on the same layout as the portal (because of the "Go to Portal Row" step.

Good Luck
Bergson

Last edited by Bergson; 12-19-02 at 15:44.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On