switchboard problem

  • Thread starter Thread starter katheryn barry via AccessMonster.com
  • Start date Start date
K

katheryn barry via AccessMonster.com

I know there has to be an easy answer to this but I can't seem to find it.
I have created a form for my switchboard that contains a dropdown menu for
selection of a particular project manager. I have the command button marked
"OK" perform the following event procedure:

Private Sub Command4_Click()
DoCmd.OpenQuery "Open by PM"
DoCmd.Close acForm, "Select Project Manager"
End Sub

The criteria in the query is as follows:
[Forms]![Select Project Manager]![cboPM]

This query works fine but I would like to have the information displayed as
a report vice a query database list. When I build a report using the above
query I get an enter parameter box asking for [Forms]![Select Project
Manager]![cboPM].

How do I enable the "OK" button on my form to display a report of the query
information?
 
katheryn said:
I know there has to be an easy answer to this but I can't seem to
find it. I have created a form for my switchboard that contains a
dropdown menu for selection of a particular project manager. I have
the command button marked "OK" perform the following event procedure:

Private Sub Command4_Click()
DoCmd.OpenQuery "Open by PM"
DoCmd.Close acForm, "Select Project Manager"
End Sub

The criteria in the query is as follows:
[Forms]![Select Project Manager]![cboPM]

This query works fine but I would like to have the information
displayed as a report vice a query database list. When I build a
report using the above query I get an enter parameter box asking for
[Forms]![Select Project Manager]![cboPM].

How do I enable the "OK" button on my form to display a report of the
query information?


If you close, is normal that it request
--
_ _
Ciao
MAssimiliano Amendola www.accessgroup.it
Cisa1 - I° Conferenza Italiana per Sviluppatori Access Arezzo 4+5
Giugno 2005 Sono aperte le iscrizioni Info: www.donkarl.com/it
 
Do you have to close the "Select project manager" form ?
This is where the problem is, with a query it will have processed the data
before the form closes but a report will take longer and the form will close
before processing is complete.
 
I know there has to be an easy answer to this but I can't seem to find it.
I have created a form for my switchboard that contains a dropdown menu for
selection of a particular project manager. I have the command button marked
"OK" perform the following event procedure:

Private Sub Command4_Click()
DoCmd.OpenQuery "Open by PM"
DoCmd.Close acForm, "Select Project Manager"
End Sub

The criteria in the query is as follows:
[Forms]![Select Project Manager]![cboPM]

This query works fine but I would like to have the information displayed as
a report vice a query database list. When I build a report using the above
query I get an enter parameter box asking for [Forms]![Select Project
Manager]![cboPM].

How do I enable the "OK" button on my form to display a report of the query
information?
It's easier to change the method you are using.

Create a new unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
ProjectManagerID field and the ProjectManager Name.
Name the Combo Box 'cboPM'.
Set it's Bound column to 1.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query that is the Report's Record Source [ProjectManagerID]
field criteria line write:
forms!ParamForm!cboPM

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the ProjectManager
name.
Click the command button and then report will run.
When the report closes, it will close the form.
 
That makes sense - I was opening the form, running the query and attempting
to run the report before closing the form, I got the correct information
but it would print automatically and then default back to the query view
which might also be a problem with the report's close event, which I didn't
check - Thanks, very helpful.
 
Back
Top