open report through form

A

Annelie

I would like to create a form to open a report. This report lists data for
employees. I have a combo box from which I can select one of the employees.
How can I create this form that opens the report and asked me to select a
specific employee from the combo box?

Annelie
 
A

Annelie

I see there was a similar question on the 9th. However, I do not understand
the explanations all the way. Can someone do a step by step procedure?
Annelie
 
E

Emu

Hello,
I have a similar problem. Pls Help.

FormA has a command to call ReportA and its characteristics are:

Private Sub Command24_Click()
On Error GoTo Err_Command24_Click

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportA", acViewPreview, , "[WarrantyID] = " &
[WarrantyId]

Exit_Command24_Click:
Exit Sub

Err_Command24_Click:
MsgBox Err.Description
Resume Exit_Command24_Click

End Sub

ReportA is linked to a SQL View (qryReport which works fine by linking
several tables).
The WarrantyID (int) is PrimaryKey stored in a SQL table (tblWarranty) and
has Identity set to Yes.

When activeting the command, the Report always shows an old record and is
not trasporting the information from FormA.
TIA.
Emu
 
M

Mike

I too have this problem however, works with mdb data. The problem must be
related with SQL tables or query were the problem repeats.
 
D

Duane Hookom

Select the employee in the combo box and then use code to open the report.
Dim strWhere as String
strWhere = "[EmployeeID] = " & Me.cboEmployeeID
DoCmd.OpenReport "rptEmpInfo", acViewPreview, , strWhere
 

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