User form on Report

C

Cody Kiroff

Hello,
First, I would like to preface by saying I am an intern and my time is
ending soon. I want to have this working before I leave.

What I want:
I have a form with several subs. I want them to be put onto a report.
(done, no problem) There is another section that needs to be filled out and
will change with each record. I was unsure how to set up a table for this,
so I haven't yet. This is my first access endeavor.
I want the user to click the print record button on the form and have the
following occur:
1)Insert all values from form into the report
2)Leave a table on the report blank so the user can fill out the information
after the report event.

Please help
 
A

Albert D. Kallal

The simple solution is to simply base your form on a table, and then also
base the report on this it on the same table.

then the code that you have to launch the report will simply filter the
report or restrict the report to the current one record you're using the
code is as follows is quite simple

me.Refresh ' you **must** write data to table so report can see it

docmd.OpenReport "nameOfReport",acViewPreview,,"id = " & me!id


the above is all you need to keep in mind that the above since you have a
primary key in your table called id. the above opens report in preview mode,
but if you drop the acViewPreview it will go directly to your printer.

Not knowing your skill level of some details of this application, you're
probably a best stick to bound fields as then your report will be far easer
to build and maintain.
 
C

Cody Kiroff

I have some experience in c and c++ programming. I do have my form based on
tables.

What is the reference for me!id? I want the report to have all the fields
that are contained on the form that reference a table. I think that I can
run a query based on the record source of the form and then run a report
based on that. Is this correct, if so, how would I do this?

Then, I can't make new tables right now as I have two days left. Is there
some vba I could insert that would produce a table with three columns and
nine rows. I want the user to generate the report with the information from
the form (that references tables) they just completed. Then this table would
be blank, but editable.

Please help. Without this, my database will be useless.

Thanks in advance.
 
A

Albert D. Kallal

Cody Kiroff said:
I have some experience in c and c++ programming. I do have my form based
on
tables.

Sorry I missed this thread...hope it is not too late offer the following...

What is the reference for me!id?

That is the current record we are on in the form. (me = current name of for
I want the report to have all the fields
that are contained on the form that reference a table.

Right, just build the report based on the same table. You don't even need a
query here.
I think that I can
run a query based on the record source of the form and then run a report
based on that. Is this correct, if so, how would I do this?

You don't have to run a query. the "openReport" command will **filter** the
report to the ONE record we are veiwing.

that done via the "id = " & me!id
eg:

docmd.OpenReport "nameOfReport",acViewPreview,,"id = " & me!id
 

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