Report from mulitple points

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

Guest

I have an invoice report that is created in a batch. The qeury behind the
report gets the incoicenr from the batch.

Now I want to create a functionality to print a copy of the invoice. So I
created a form, with a text box for an invoicenr. I created a new report that
gets the invoicnr from the the new form.

So it is clear, and working fine.
I have now 2 invoice reports, and two times maintenance.

My question.
Is it possible to create one invoice report, that can work with the batch
and with the form.
Can I create a dynamical report, without the problem of binding it to a
tabel or form.
Should I use qeury behind the report?
Is there a vb example?


thanks for the help
 
Abrm said:
I have an invoice report that is created in a batch. The qeury behind the
report gets the incoicenr from the batch.

Now I want to create a functionality to print a copy of the invoice. So I
created a form, with a text box for an invoicenr. I created a new report that
gets the invoicnr from the the new form.

So it is clear, and working fine.
I have now 2 invoice reports, and two times maintenance.

My question.
Is it possible to create one invoice report, that can work with the batch
and with the form.
Can I create a dynamical report, without the problem of binding it to a
tabel or form.
Should I use qeury behind the report?
Is there a vb example?


One report should be possible. Usually the key to this is
to design the report to print every report in the table, or
a query that selects all potentially elegible invoices.
Then you can use the OpenReport method's WhereCondition
argument to filter the report to the single or "batch" of
invoices you want at any particular time.

Note that this approach depends on you having a form where
users can specify the invoice(s) and a button to run the
report along with fields in the invoice table that can be
used to filter the data as specified on the form.
 
I created this syntax but it doesn't work.
dim invoicnr as string
invoicenr = 1111
DoCmd.OpenReport ("invoice"), acViewPreview, , (((invoicetable![invoicenr])
= invoicenr))
 
Please don't say "doesn't work" without explaining what did
happen.

I see some syntax errors. If invoicenr is a Text field (as
implied by your variable declaration_, then try it this way:

Dim strInvNo as string
strInvNo = "1111"
DoCmd.OpenReport "invoice", acViewPreview, , _
"invoicenr = """ & strInvNo & """"

If invoicenr is a numeric type field (as its name implies),
then, it would be:

Dim lngInvNo as string
lngInvNo = 1111
DoCmd.OpenReport "invoice", acViewPreview, , _
"invoicenr = " & lngInvNo
--
Marsh
MVP [MS Access]

I created this syntax but it doesn't work.
dim invoicnr as string
invoicenr = 1111
DoCmd.OpenReport ("invoice"), acViewPreview, , (((invoicetable![invoicenr])
= invoicenr))

Marshall Barton said:
One report should be possible. Usually the key to this is
to design the report to print every report in the table, or
a query that selects all potentially elegible invoices.
Then you can use the OpenReport method's WhereCondition
argument to filter the report to the single or "batch" of
invoices you want at any particular time.

Note that this approach depends on you having a form where
users can specify the invoice(s) and a button to run the
report along with fields in the invoice table that can be
used to filter the data as specified on the form.
 
I tested the options, and it works fine.
Thanks for your help.


Marshall Barton said:
Please don't say "doesn't work" without explaining what did
happen.

I see some syntax errors. If invoicenr is a Text field (as
implied by your variable declaration_, then try it this way:

Dim strInvNo as string
strInvNo = "1111"
DoCmd.OpenReport "invoice", acViewPreview, , _
"invoicenr = """ & strInvNo & """"

If invoicenr is a numeric type field (as its name implies),
then, it would be:

Dim lngInvNo as string
lngInvNo = 1111
DoCmd.OpenReport "invoice", acViewPreview, , _
"invoicenr = " & lngInvNo
--
Marsh
MVP [MS Access]

I created this syntax but it doesn't work.
dim invoicnr as string
invoicenr = 1111
DoCmd.OpenReport ("invoice"), acViewPreview, , (((invoicetable![invoicenr])
= invoicenr))

Abrm wrote:
I have an invoice report that is created in a batch. The qeury behind the
report gets the incoicenr from the batch.

Now I want to create a functionality to print a copy of the invoice. So I
created a form, with a text box for an invoicenr. I created a new report that
gets the invoicnr from the the new form.

So it is clear, and working fine.
I have now 2 invoice reports, and two times maintenance.

My question.
Is it possible to create one invoice report, that can work with the batch
and with the form.
Can I create a dynamical report, without the problem of binding it to a
tabel or form.
Should I use qeury behind the report?
Is there a vb example?
Marshall Barton said:
One report should be possible. Usually the key to this is
to design the report to print every report in the table, or
a query that selects all potentially elegible invoices.
Then you can use the OpenReport method's WhereCondition
argument to filter the report to the single or "batch" of
invoices you want at any particular time.

Note that this approach depends on you having a form where
users can specify the invoice(s) and a button to run the
report along with fields in the invoice table that can be
used to filter the data as specified on the form.
 
Back
Top