devxlogo

ActiveX & Data controls

ActiveX & Data controls

Question:
I Want to make my own data control navigator bar in a single OCX. My question is: How can i get the DataSource property to work.

It needs to give me a list of all availables Data controls on the form and let me pick one of them in the property list.Also it needs to send the command to that Data control. Eg: Data1.Recordset.MoveNext.

Answer:
You can loop through the controls in the Controls collection of the Form.Use the TypeOf function to build a line like this:

If TypeOf(loopVar) Is DataControl Then   add it to the list
Use the class name of the Data control, which is the text next to the namein the Properties window.

See also  How to Block Websites During Certain Hours on a Mac Computer
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist