Form to Report Linking

  • Thread starter Thread starter NorthStar
  • Start date Start date
N

NorthStar

Good morning everyone;



I'm designing a database to record and produce military driver's licenses.
I have the input form designed using a tabbed control so that I can have
basic license info on one tab, vehicle qualifications on a second tab,
trainer info on the third, organization info on the fourth, and contact info
on the fifth. The key field for the basic table is the SSAN and the linking
field for vehicle and trainer info is also the SSAN. Information is
presented on the second and third tabs via linked subforms.



The first report I've designed prints a military drivers license (MDL) and
is activated by clicking a control button in the footer of the form. The
on-click event for the button control activates a macro that opens the MDL
report in print preview mode. The report is driven by a query that has the
following statement in the first criteria for the SSAN field:



Forms![Form - License Data Input]![SSAN]



This is so that when I click the print button, I get an MDL for that one
person and not for everyone in the database. I've done this in a similar
database for work order production and it works fine. However, in this MDL
database, it doesn't work. Instead of Access showing me the driver's
license for the person I just entered/edited, I get a dialog box on the
screen that repeats the forms statement above.



I don't understand why this statement should work for the work order
database and not for the MDL database. Can anyone tell me what I'm doing
wrong and how to fix it? I'm using Access 2000 for this application.



Thanks,



John.


--
NorthStar

Always do right. This will gratify some people and astonish the rest.

Spam protected -- Remove _NadaSpam_ to e-mail
 
When you get a dialog such as the one you are mentioning, it is asking for
the parameter. Since you have done this before, I assume you know that the
form must be open (visible or hidden, but open) for the query to retrieve
the data from the form. That being the case, then a typo is usually the
problem. Check your spelling and, since you have spaces in the name, check
the number of spaces between in case there is a double space in what you
typed.
 
Check the following:
1. Is the form's name actually "Form - License Data Input"?
Make sure the punctuation and spaces are all correct.
(Most experienced developers prefer form names without spaces.)
2. Is the textbox on the form actually named SSAN?
3. Is the form open at the time the report is run?

HTH
- Turtle
 
Problem solved.

When I designed the databases, I named the two linking fields SSAN. Since
both fields were named SSAN, the query got confused about which SSAN field
to look at. I renamed the fields SSAN Basic and SSAN Qualifications and the
problem was solved.

Thanks to Wayn Morgan and MacDermott for the input.

--
NorthStar

Always do right. This will gratify some people and astonish the rest.

Spam protected -- Remove _NadaSpam_ to e-mail
 
I'm glad you got it working. Instead of renaming the fields, another
possibility may have been to refer to them by the table name and field name.

Example:
Table1.SSAN
Table2.SSAN

This will also remove the ambiguity.

--
Wayne Morgan
Microsoft Access MVP


NorthStar said:
Problem solved.

When I designed the databases, I named the two linking fields SSAN. Since
both fields were named SSAN, the query got confused about which SSAN field
to look at. I renamed the fields SSAN Basic and SSAN Qualifications and the
problem was solved.

Thanks to Wayn Morgan and MacDermott for the input.

--
NorthStar

Always do right. This will gratify some people and astonish the rest.

Spam protected -- Remove _NadaSpam_ to e-mail

NorthStar said:
Good morning everyone;



I'm designing a database to record and produce military driver's licenses.
I have the input form designed using a tabbed control so that I can have
basic license info on one tab, vehicle qualifications on a second tab,
trainer info on the third, organization info on the fourth, and
contact
info
on the fifth. The key field for the basic table is the SSAN and the linking
field for vehicle and trainer info is also the SSAN. Information is
presented on the second and third tabs via linked subforms.



The first report I've designed prints a military drivers license
(MDL)
and
is activated by clicking a control button in the footer of the form. The
on-click event for the button control activates a macro that opens the MDL
report in print preview mode. The report is driven by a query that
has
the
following statement in the first criteria for the SSAN field:



Forms![Form - License Data Input]![SSAN]



This is so that when I click the print button, I get an MDL for that one
person and not for everyone in the database. I've done this in a similar
database for work order production and it works fine. However, in
this
MDL
database, it doesn't work. Instead of Access showing me the driver's
license for the person I just entered/edited, I get a dialog box on the
screen that repeats the forms statement above.



I don't understand why this statement should work for the work order
database and not for the MDL database. Can anyone tell me what I'm doing
wrong and how to fix it? I'm using Access 2000 for this application.



Thanks,



John.


--
NorthStar

Always do right. This will gratify some people and astonish the rest.

Spam protected -- Remove _NadaSpam_ to e-mail
 
Back
Top