open report through form

  • Thread starter Thread starter Annelie
  • Start date Start date
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
 
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
 
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
 
I too have this problem however, works with mdb data. The problem must be
related with SQL tables or query were the problem repeats.
 
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
 
Back
Top