how to extract the req info to the report

sunilvedula

Sunil
Local time
Today, 08:39
Joined
Jan 18, 2007
Messages
138
hi

i want the report to display only the selected fields but it displays the complete list. pls have a look at the code and help me.

Code:
Private Sub CmdOploss_Click()

Dim rs As New ADODB.Recordset
Dim Cnxn As New ADODB.Connection, q_str As String


Cnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = J:\Disputes_PE\CORE\O4\O4.mdb"
Cnxn.Open

rs.Open " Select * FROM qOploss " _
& " where TblOploss.Empid = '" & CboxHbiid.Value _
& "' and TblOploss.Mth = '" & CboxMth.Value _
     & "'AND TblOploss.Yr = " & CboxYr.Value & "", Cnxn, adOpenDynamic

If rs.EOF Then
MsgBox "No Records Found try again"
Else

DoCmd.OpenReport "RptOploss", acViewPreview
End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom