RE: Access Database Reports



Sorry I could not get back to you yesterday, Steve.

If it is asking for a parmeter, then it can't find the control on the form.
As to your other ideas, there are better ways to do it.

My actual preferred way, rather than using a reference in the query, is to
have no reference in the query, but use the Where argument of the OpenReport
method. I did not mention that earlier, because I did not know whether you
were using VBA or a Macro to open the report. In this method, you still use
the field in the report's recordset you want to filter on and you reference
the control like this:

Dim strWhere As String

strWhere = "[PO] = " & Me.txtPONumber

Docmd.OpenReport "MyReport", , , strWhwere
--
Dave Hargis, Microsoft Access MVP


"Steve" wrote:

Is there any way we can contact you by phone. I'm a bit under the gun here,
as you can tell from my past few replies. Thanks, Steve

"Klatuu" wrote:

Well, to clarify, a field is a property of a table or query that contains a
data item. Although even Microsoft erroneously referrs to controls as
fields, they are not. Controls are property of forms and reports. Many
control types can be bound to a field in the report's record source, so to be
accurate, when you refer to a field, you are talking about a a table or
query. When you refer to a control, you are talking about the property on
the form used to display either the value of the field it is bound to or a
calculated value.

So to answer your question, My previous post with

Forms!NameOfFormHere!NameOfOrderNumberControlHere

breaks down like this:

Forms - A reference to the application's Forms collection
NameOfFormHere - The actual name of the form. Specifies the member of the
collection.
NameOfOrderNumberControlHere - The name of the control on the form that has
the field in the form's record source indentified in its control source
property.

So that's how it all ties together
--
Dave Hargis, Microsoft Access MVP


"Steve" wrote:

Good morning Klatuu,

I am on my way to dinish up my database and have one question. The syntax
for the reference to the form and control name. The control name would be
the name for the field where the control number (the purchase order number
here) is?

"Klatuu" wrote:

Sure take all the time you need.
You have 10 minutes, starting now :)

No, really, at your convenience. Post back if you have additional questions.
Good luck.
--
Dave Hargis, Microsoft Access MVP


"Steve" wrote:

I will try this. Is it possible that I can continue this thread a little
later? I will need some time, even though your instructions are excellent,
to work my way though this. I appreciate your help and patience.

"Klatuu" wrote:

Okay, the Record Source of the report should be a query that joins the
customer information table with the order information table.

I don't know how you are opening your report, but I will assume you are
using a command button on your form that runs either some VBA code or a
macro to open the report.

To keep it as simple as possible for you, I would suggest you open the
report's record source query in design view and find the column with the
Order Number

The will be a row or rows labeled Criteria. In this row and in the Order
Number column, put a reference to the form and control name on the form where
the order number is. The syntax would be:

Forms!NameOfFormHere!NameOfOrderNumberControlHere

That will cause only that one order to be printed.
--
Dave Hargis, Microsoft Access MVP


"Steve" wrote:

Yes. Only the information from that order, along with the his/her
information from the 'customer' table.

"Klatuu" wrote:

So let me see if I understand.
When you create an order for a customer, you want to create a confirmation
report that includes only the newly created order, right?
--
Dave Hargis, Microsoft Access MVP


"Steve" wrote:

Hello Klatuu,

First, thank you for this very prompt response. Please forgive me but I am
very new to Access. I have created a database with a number of tables. I
created a report with various fields from each of two of the tables. I want
to create a report each time I enter information into one of the tables,
using data from both tables. Only the information from one of the tables
changes. So, I have a table of 'customers' which remains the same
throughout. Then I have a table of 'orders', where I enter new orders as
they arrive. I combine the information from both tables to create a 'report'
which is actually an order confirmation to be sent back to the customer.
Does this make any sense?

"Klatuu" wrote:

You cannot edit an Access report. It is not an interative object (other than
in design view). It is only a view of a set of data based on some criteria
at the point in time the report was created.

What is it you are trying to accomplish?
--
Dave Hargis, Microsoft Access MVP


"Steve" wrote:

I want to edit an access report. Whenever I try to add more database
information to a report, the report is appended. I do not want multiple
pages, I just want to insert new database entries into the report, print it
to .pdf (an easy one I can already do) then edit the report with new data and
keep repeating the process. Please help, I'm really new to all of this.
.


Loading