
Parameter Queries and Data Controls
Hi,
I am trying to build a form that will have an expanding bottom portion
taht will show all of the detail records for a selected record. When
the user selects the expand button, I expand the form and set up my
querydef and recordset objects. I then open the recordset and assign it
to the data control. This works fine. When the user the selects the
shrink button to show only the main record and leaves this form, I close
the querydef and recordset. If the user comes back to this form and
selects the expand again, I get error "525 Data Access Error". Any
ideas.
Here is the code for the expand button.
cmdAddStudents.Caption = "<<< Students"
Set studentQd = addDb.QueryDefs("qrygetstudent")
studentQd.Parameters!corpkeyparm = corpnum
Set studentRs = studentQd.OpenRecordset(dbOpenDynaset)
Set dataAddClass.Recordset = studentRs
Here is the shrink Button.
studentRs.Close
studentQd.Close
Set studentRs = Nothing
Set studentQd = Nothing
Thanks in Advance,