Store data from text box

G

Guest

I have two related questions. First for each of my records in my database I
print a catalog label. Each label is created by the data inputed into the
fields of the form. On the form I have a text box where I compile the data
using this expression in the data control source for that text box
"=Forms!CoinTable!Year & "-" & MintMark.Column(1) & " " & Series.Column(1) &
Chr(13) & Chr(10) & CountryOfIssue.Column(1)" Is there a way I can save this
data in the table? I've tried putting the above expression in the default
value field, but it will not display the data that is entered at the time the
form is filled out. Would it be best to build a query that compiles this info
at a later date?

That brings me to my second question. If I do make a query to handle this
info, I would want to create a report that would print a batch of labels at
the same time. How would I set a control where I could check something on the
main form, the compile the results of all the checked records, print the
report, then clear all those checks so I don't have to reprint every record
every time.

Thanks,
 
J

John W. Vinson

I have two related questions. First for each of my records in my database I
print a catalog label. Each label is created by the data inputed into the
fields of the form. On the form I have a text box where I compile the data
using this expression in the data control source for that text box
"=Forms!CoinTable!Year & "-" & MintMark.Column(1) & " " & Series.Column(1) &
Chr(13) & Chr(10) & CountryOfIssue.Column(1)" Is there a way I can save this
data in the table?

There's no reason that you should.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
Would it be best to build a query that compiles this info
at a later date?

Use a similar expression based on the table fields rather than the form
controls in a Query.
That brings me to my second question. If I do make a query to handle this
info, I would want to create a report that would print a batch of labels at
the same time. How would I set a control where I could check something on the
main form, the compile the results of all the checked records, print the
report, then clear all those checks so I don't have to reprint every record
every time.

You can base the Report on a query using

=Forms!CoinTable!CoinID

(or whatever field identifies what you want printed) as a criterion to select
just the desired record or records for printing.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top