Solved

Question on  ActiveX control

Posted on 1998-06-18
2
191 Views
Last Modified: 2013-11-26
1. How to attach a "File Open Dialog box" for a property of    an ActiveX control (when creating a User control)

   For ex: Using Data Control in VB, When a user                       selects Database property, an ellipse will be               appeares and when he clicks on the ellipse,                 Windows File Open dialog box is displayed.

2. How to display a no. of options for a property of an       ActiveX control DYNAMICALLY(when creating a User control)

   For ex: Using Data Control in VB, when a user gives                 Database name and when he clicks on                         RecordSource property, all the table names in               that database are dynamically displayed.

CAN ANYBODY HELP ME BY ANSWERING MY QUESTIONS?
Thanks in advance.
0
Comment
Question by:nrk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
cerik earned 100 total points
ID: 1463642
to answer 1.

You could try simply pasting a dialog control into your activeX and calling it in a click event mapped to the ellipse object(there is also an API cal that does the same thing),
setup the click event in the activex wizard and set the call dialog there, like

Private Sub UserControl_Click()
    'you can set default file extentions etc.. here
    CommonDialog1.showOpen
    'set database property
    data1.Database = CommonDialog1.FileName
    'but be careful if you have mapped the database property, set the internal property value and not the data1.database property directly  
    RaiseEvent Click
End Sub

 2.

Again in the activeX setup wizard add the recordset property, and further along, map it to the data control, this will give your activeX the same dropdown recordsets as the data control has, you should have something like this in your code.
 
Public Property Get Recordset() As Recordset
    Set Recordset = Data1.Recordset
End Property

You can do the same thing with datasource and other items like this.

Hope this is enough detail
0
 
LVL 2

Expert Comment

by:Jagar
ID: 1463643
For question 2 you can make and Enumeration and then declare the property to be of the enumeration type.  Make sure and make the enumeration public.  Then VB IDE will handle the rest.
I don't know about the anwser to the first question.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question