Expand|Select|Wrap|Line Numbers
- Private Sub Command_Click()
- Dim a As String
- a = InputBox("enter empno")
- If rs.State = 1 Then rs.Close
- rs.Open "select * from microbiology Where bat_num = " & a, cn, adOpenForwardOnly, adLockReadOnly
- LinkDataReport1
- end sub
- Public Sub LinkDataReport1()
- With DataReport2
- 'We must set The DataReport source to nothing!
- 'Else DataReport wants to use its own Source
- Set .DataSource = Nothing
- .DataMember = ""
- 'We Connect the DataReport to our Recordset Since
- 'we disallowed DataReport1 to use its own above
- Set .DataSource = rs
- 'Here we are 'Hard Coding the textboxs to the fields
- With .Sections("Section1").Controls
- .Item(1).DataMember = ""
- .Item(1).DataField = rs.Fields(0).Name
- .Item(2).DataMember = ""
- .Item(2).DataField = rs.Fields(1).Name
- .Item(3).DataMember = ""
- .Item(3).DataField = rs.Fields(2).Name
- .Item(4).DataMember = ""
- .Item(4).DataField = rs.Fields(3).Name
- .Item(5).DataMember = ""
- .Item(5).DataField = rs.Fields(4).Name
- End With
- .Show
- End With
- End Sub
Object does not support this property or method
while in the above code when iam using with datareport1 i am not getting error
what is the problem i am not able to understand please help if any can