Expand|Select|Wrap|Line Numbers
- Dim rsname1 as recordset
- Dim conn As Connection
- Set conn = New Connection
- conn.Open "provider=Microsoft.jet.OLEdb.4.0;Data Source=C:\Documents and Settings\admin\My Documents\medical.mdb"
- Set rsname1 = New Recordset
- rsname1.Open "select * from MASTER order by [PRODUCT NAME]", conn, adOpenDynamic, adLockPessimistic
- If Option2.Value = True Then
- rsname1.Close
- Set rsname = Nothing
- rsname1.CursorLocation = adUseClient
- rsname1.Open "select * from MASTER order by [COMPANY NAME],[PRODUCT NAME],[PRODUCT TYPE],[PRODUCT SIZE]"
- Form3.DataGrid1.DataMember = ""
- Set Form3.DataGrid1.DataSource = rsname1
- Form3.DataGrid1.Refresh
- rsname1.Requery
- ElseIf option1.Value = True Then
- rsname1.Close
- Set rsname1 = Nothing
- rsname1.CursorLocation = adUseClient
- rsname1.Open "select * from MASTER where [COMPANY NAME]='" & Combo1.Text & "' and [PRODUCT NAME]='" & Combo2.Text & "' and [PRODUCT TYPE]='" & Combo3.Text & "' and [PRODUCT SIZE]='" & Combo4.Text & "', conn, adOpenDynamic, adLockPessimistic"
- Form3.DataGrid1.DataMember = ""
- Set Form3.DataGrid1.DataSource = rsname1
- Form3.DataGrid1.Refresh
- rsname1.Requery
- End If
- End Sub
till now u might understood the problem m facing.actually problem is with option 2 ie single type.after clicking the command button values must appear in grid.
the error msg m getting is object r variable not decalred.please help me sir
thank u