auto fill?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database I use to track certain information regarding alcohol citations. I want to expand the database to generate the actual citation itself. In tblCitation the primary key is CitationNumber with a data type of text. I need the citation number to display in at least one and up to four areas of the citation report, depending on what they are licensed for. For example, if the alcohol establishment is licensed for beer, wine, and consumption liquor, I need the license number to display on the citation in all three areas; if the establishment is licensed for beer and wine only, the license number should display in just those two areas, etc. I plan to add a yes/no field to the citation table for each of the four license types. Is there a simple way to make the license number display for each field that has a yes answer? How? My Access skills are limited and any help would be very much appreciated! Thank you much (again).
 
I am pretty new to this stuff too, but this group has been
a great help. In fact, it is why I am able to offer an
answer at all.
I would start with a table, creating it in design view.
For now, keep it minimal. Add a field (column) for ID,
one for Beer, and one for Wine. Set the Data Type to Text
for ID, and to Yes/No for Beer and for Wine. Save the
table. Start a new form in design view. If the form's
property sheet (it has tabs for Format, Data, Event, Other
and All). If not, double click the sort of small box with
a dark square in the middle of it, just to the left of the
ruler at the top. Click the Data tab, click in Record
Source, click the down arrow, and select your table. A
box with the table's fields will appear. Drag all three
fields (ID, Beer, Wine). ID will be a text box, the
others will be check boxes. Click each one, and at the
Other tab give them useful names. I avoid spaces in the
names. Click View > Tab Order, and arrange the fields
with ID at the top. Now, if the toolbox is not available,
click View > Toolbox. Just below the magic wand symbol is
an ab| symbol. Click it, then click the form next to the
Beer check box. You just added a text box. In the
property sheet for the text box, click the Data tab, then
click Control Source. At Control Source, type
=IIf([Beer]=Yes,[ID],"")
There are no spaces in there. Do the same thing next to
the Wine check box, and substitute [Wine] for [Beer].
Switch to form view. Type a number into ID, and check the
box at Beer. The ID should appear in the Text box you
just created.
Forms and reports in Access are a little different from in
common usage. A form in Access is where you enter
information, find records, etc. A report is the thing you
print. Create a report in design view, using your table
as the Control Source, and do just what you did to make
the form as far as adding fields, etc. Back to the form,
click the magic wand at the top center of the toolbox if
it is not already highlighted. Click the Command Button
icon, and click the form. Follow the prompts in the
wizard to create a button on the form that will open the
report.
Once you have it working at the basic level, add fields
and all the rest that you need to the table, form, and
report. More questions will arise, of course, but I think
this will get you started.
-----Original Message-----
Thanks for replying Howard. I'm not sure I understand
you answer though. Sorry... I'm really new at this.
Currently we are manually typing on a pre-printed citation
form and I've been ask to design the citation to look like
it. At the top of the form the different license types
are spelled out with a blank to the right of them. (Beer
_____ , Wine _____ , etc.) We manually type the alcohol
number in the blank space, so if the establishment is
licensed for both beer and wine we would type the license
number twice. I don't think I want to store the number
more than once in the table, but I do want it to show more
than once on the report, depending on what they're license
for. I was thinking maybe there is some way to create a
query (upon which the report would be based) that says if
you answer yes to beer, yes to wine, and no to liquor -
the license number would populate the blank space to the
right of the report label beer, and the report label wine,
and the space would remain blank for liquor. So in the
table I would have a field "License Number" (primary key)
which I would enter the license number into, another
field "Beer" that I could anser yes to, a field "Wine"
that I could answer yes to, and another "Liquor" that I
could answer no to. When you say "As part of the source
query for the report, I would include the type of
establishment (beer, wine, consumption alcohol) and
reference that to determine whether to print the licence
or citation number on the report", how do I reference it?
Thanks again. This newsgroup has already saved me several
times!
 
I appreciate your letting me know. It is gratifying to
know that just a few months after getting started myself I
am able to be of help from time to time.
-----Original Message-----
Your instructions were so easy to follow. And it
worked! Thank you so very much, Bruce.
 
Back
Top