sunilvedula
Sunil
- Local time
- Today, 06:56
- 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.
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