Solved

Question on  ActiveX control

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

809 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