Running a query from a form to create a report

SparkySX

New member
Local time
Today, 06:47
Joined
Jul 21, 2009
Messages
3
Hi all,

Im in no way experienced with Access so please be patient, as I may not understand some of the most simple bits.

I have setup a form, which opens in Add mode. When the user fills in the fields on the form, once saved, it saves to a table.

What i want to do is, have a button at the end, which will run a query which then:

Saves the form,
Creates a report from the data just entered. (I would like to create a standard looking report)

How is this done?

I would also like an option from the switchboard that allows you to search for a record using the primary key value (an autonumber), and then either re-print that entry in the report view or delete the entry.

Any help is appreciated!

Phil
 
welcome here!

first of all you can always use the templates provided in ms office for your reference examples how things are done.

secondly, you dont need a query to save a form but rather a code to save record you input in the form to the table you wanted it to be saved.

i have started access thru studying the templates. maybe you should too because that would be your fastest way to learn from my own point of experience.
 
Thanks for your fast reply marianne.

Ive tried looking at templates and examples ive downloaded but still cant make head nor tail of how I could do it.
 
wow, i cant think of anyway for you as a beginner but to learn the basics thru templates.
 
Ive done a lot of looking about and found the GoCMD.OpenReport which seems to be the thing i need.

So far ive got:

--------------------------------------------------------------------
Private Sub Command26_Click()

DoCmd.OpenReport "rptQC", acViewPreview, , "QCREF = " & QCRef

End Sub
--------------------------------------------------------------------

The only problem is, its not pulling from the form its in, it instead asks with an enter parameter box, and when you enter the QCREF you require, itll report correctly on this QCREF.

Can anyone tell me where its wrong?
 

Users who are viewing this thread

Back
Top Bottom