passing a data control 
Author Message
 passing a data control

AL->  Sub Myfn(datTheDataControl as Control)
  ->        datTheDataControl.Recordset.MoveNext

AL->        Sub Myfn(frmTheForm as Form)
  ->           frmTheForm!Data1.Recordset.MoveNext
  ->        End Sub

AL-> I've tried to pass the data control to the procedure too,
     but either
  -> can't get the syntax right or VB just won't allow that.  What do
     you
  -> declare it as?  Control didn't work (ie: (datTheDataControl as
  -> Control)).

   I've tried doing the same thing in my applications before and have
come up with the same error! So I eventually gave up on data
controls. However, I was just given a quick and dirty job to do and
decided to give data controls a try again. I may have stumbled accross
the answer, but it seems to good to be true. I haven't had a problem
yet, but give it a try.

I simply declared my sub as
        Sub MyFn(dta as Data)
                dta.DatabaseName=strDatabase
                dta.refresh
                dta.Recordset.Movenext
        end Sub

To my amazment, using the DATA in the declaration seems to have worked!
I know I've tried this millions of time before. Give it a try, let me
know how it turns out. I would think I had tried this before, but I no
longer am sure.

Good Luck.

let me know how it turned out!



Fri, 26 Dec 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. : How to pass a data control as a parameter.

2. : How to pass a data control as a parameter.

3. Passing field data from data control between forms

4. passing data controls and control arrays as parameters

5. Help passing data control value to another form

6. : How to pass data control as parameter, part II

7. Executing Access queries with Data Control and parameter passing

8. Data control passing??

9. HELP! Passing Data Control Value to another Form

10. : How to pass data control as parameter, part II

11. Passing Data from a Dyname to a Static Control

12. ? regarding passing data from VC to VB using ActiveX control

 

 
Powered by phpBB® Forum Software