Solved

Question on  ActiveX control

Posted on 1998-06-18
2
192 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

740 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