Solved

Question on  ActiveX control

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

695 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