Using Parameter Queries and Data Controls 
Author Message
 Using Parameter Queries and Data Controls


I am building a form that has a hidden bottom section that will contain all records for a given parent record on the top of
the form.  When the user selects the button I.E. (<<<< Students) to expand the form, I set the recordset and querydef
objects, open the recordset and assign it to the data controls recordset property.  When the user then selects the shrink
button I.E. (Students>>>>) the form returns to its normal size.  The problem is that when they select the expand againd, I
get error 525 Data access error.  I do not know what to do.  Should I refresh the data control, and if I do, ho do I stop it
from wanting the parameters?

Here is the code that I am using for the Expand/Shrink Button

Private Sub cmdAddStudents_Click()
    If cmdAddStudents.Caption = "Students >>>" Then
        frmAddClass.Height = 7050
        cmdAddStudents.Caption = "<<< Students"
        Set studentQd = addDb.QueryDefs("qrygetstudent")
        studentQd.Parameters!corpkeyparm = corpnum
        Set studentRs = studentQd.OpenRecordset(dbOpenDynaset)
        Set dataAddClass.Recordset = studentRs
        frmAddClass.Height = 4560
        cmdAddStudents.Caption = "Students >>>"
        Set studentRs = Nothing
        Set studentQd = Nothing
    End If

End Sub

Thanks in Advance

Mike Needham

Sun, 15 Nov 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Passing Parameters to stored parameter queries using VB 5's Data Controls

2. Using a parameter Query with VB data control?

3. Parameter Query in VB6 Using the Data Environment

4. Parameter query for Bound Data Control

5. VB4: Parameter query&Data Control?

6. HELP with Parameter queries and Data Control

7. Parameter Queries and Data Controls

8. Parameter Queries and Data controls

9. Help! Parameter Query via Data Control

10. Data Control and Query Parameters Question

11. Parameter Queries in a VB data control

12. How to bind Parameter Query to Data Control ?


Powered by phpBB® Forum Software