Need help changing Data Control Recordsource during runtime 
Author Message
 Need help changing Data Control Recordsource during runtime

I'm writing a small app that uses a list box, a data control and a data
grid (Sheridan Data Widgets).  The data control is using a SQL query to
get the items from one invoice.  The data grid is bound to the data
control.  

When an invoice number is clicked from the list, it changes the
recordsource and requeries, but nothing changes in the data grid.

I've tried using a database variable like so:

[Declarations of form]
dim pdb_Database as database

sub Form_Load

   set db_Database=DBEngine.workpaces(0).opendatabase("data.MDB")

end sub

sub lstInvoice_Click

   dtcDetail.recordset.close
   set dtcDetail.recordset=pdb_database.openrecordset(Query with      
       value of selected listbox entry)
   dtcDetail.Requery

end sub

sub Form_Unload

    pdb_database.close
    unload me

end sub

Currently the code above will work the first time the list is clicked,
and give an error 525-Data Access Error.

Is there another way to do this?

Any help would be greatly appreciated.

Brian Futrell



Thu, 13 Apr 2000 02:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Change the RecordSource of DBGrid during runtime?

2. Changing the recordsource to a data component for a bound control at runtime

3. Need help changing password during runtime

4. Change recordsource data object at runtime

5. Changing ADO Data Control Recordsource

6. Need help on creating ICON during runtime?

7. Need help on creating ICON during runtime?

8. Need help on creating ICON during runtime?

9. Need help on creating ICON during runtime?

10. Change recordsource of subform at runtime

11. Changing ADO recordSource at runtime has no effect

12. Changing ADO recordSource at runtime has no effect

 

 
Powered by phpBB® Forum Software