Get the books out and start learning - Also use the help
but most of the
advanced things you will want to do will involve understanding VBA. Because
even your what you asked next will require you to understand the coding that
was provided. So I will give you the start...
From the access Web
1 Dim strDocName As String
2 Dim strWhere As String
3 strDocName = "rptSomeReport"
4 strWhere = "[RunID]=" & me!RunID
5 DoCmd.OpenReport strDocName, acPreview, , strWhere
1 and 2 Declare variables used
3 Assignes the name of the report - and if you want the user to be able to
put in the name of the report as you just asked - it could be a textbox on
your form (I would use a combobox but will keep it simple) you would have
strDocName = me.txtReportName
Me refers to the form that you are on the txtReportName is the name of the
textbox on the form
4 For you something like - strWhere = "[CompanyID]=" & me!CompanyID
The [CompanyID]= is the name from your query in the report or table if
based on that - againd the me!companyID - is a combo box or text box on your
form - this is designed to limit it to the company id that you wan't
5 DoCmd.OpenReport strDocName, acPreview, , strWhere this is were you open
the report obviously - you have the document name then opeing it as a preview
instead of sending it straight to the printer then you have a blank variable
USE THE Help if you want to know what this is and then there is the limiting
string.
As stated in the example this code can goes into a command buttton's On
Click Event. (a property under the Event tab for the button - make sure you
use Expression Builder and you can also set this as the default when you
click the elipse (...).
You can even take a shortcut to start you off with using the wizard to put a
button on the form to open a report. This will start you off but then you
need to understand the code to change it to what you want to do.
Hope that gets you started.
Craig