Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating controls for Access... 2

Status
Not open for further replies.

Snaggs

Programmer
Jan 11, 2000
393
US
I read somewhere in the past that the controls for Access are slightly different than the ones for Visual BASIC. I don't recall or remember what the differences were.

Visual BASIC has a control called a "DT Picker" short for "Date Picker". It's a control that looks like a combo-box and when you click on it, a calendar drops down like the one you see in Outlook.

I can get the control to load in Visaul BASIC or in Access, however, when I load it in Access I get an error saying:

"There was a problem referencing a property or method of the OLE Automation object."

I think it has to do with the fact that the control doesn't have the property that binds the control to a field in a query or table. But I don't know what it's missing for sure. If I had to take a guess, I'd say it's the DataSource property.

I looked at the Calenadar Control in Visual BASIC in the object browser to see what type of properties and methods it had. Since I can use this control in either environment, I wanted to exam it's properties and methods.

I was thinking that if I could encapsualte the Date Picker control in a Visual BASIC control and add the property that Access is looking for, I could get the control to work in MS-Access.

I can get the control to display and function in Access as the form is loaded, however, the event's don't fire when the date is changed.

Anyone know of a date picker control for Access 95 for know how I can make this control work with Access 95? Does the control work in Access 2000? If it does, then upgrading is a viable option. If someone would be so kind to see if the data picker control works in Access 2000 I would greatly appreciate it.

It's called "Microsoft Date and Time Picker Control 6.0"

Thanks for any help you might be able to offer! Snaggs
tribesaddict@swbell.net
To define recursion, we must first define recursion.
 
Actually I've never used this control before, but it seems like one that might come in handy sometime in the future.

I created a form with the control and entered this in the CloseUp Event, even thought its not one listed on the Event Tab for the control, it is in the dropdown list of events in the code module. This worked fine for me in Access 97.

Private Sub ActiveXCtl0_CloseUp()
Dim strdate As String
strdate = Format(ActiveXCtl0, "Long date")
MsgBox strdate
End Sub

PaulF
 
The "Microsoft Date and Time Picker Control 6.0" works in Access 2000 as well as VB 6.0. I have never attempted using it in previous versions of either application.

In the case of using the control in the 2000 version you'll need to select the more toolbox control option. It looks like the toolbox icon only it has the ellipse after it (The three dots)

For those of you who haven't seen this control. It looks like a combo box but when you click on it it opens a full month calender with the current date circled. You can then select the date options by clicking on the calender, cycling through the month and year options of by just typing the date in the control.

The beauty of this control is it takes care of date format issues for data entry.

HTH :)
 
Thanks to those that posted. Paul, I used your idea and it worked just great! Thanks for the post, you have my vote as Tip-Master for the week. Snaggs
tribesaddict@swbell.net
To define recursion, we must first define recursion.
 
I have a question about this control. On our system at work with Access 97 installed I attempted to use this control. It tells me I am not liscensed to use this control. The exact same comment comes up when I attempt to do it on my laptop as well. (Access 97 there also). So yesterday I figure I'll play with it on my copy of VB6 that I have installed at home. It is not even a option under more controls. So I open Access 2000 and it installs and works perfectly. What determines if a control is liscensed to be used or not. I have always operated under the assumption that if it does not give the liscensing issue it was a go. As I am not a professional developer it is not a serious issue with me but I am curious. Also if it is ok for me to use it how do I get the control to show up as an option in VB6.
 
In VB6 it shows up under the 'Windows Common Control 6.0-2' There are about 3 flavors of the Common Controls in VB 6.0, it's the second flavor of it. It's called 'DT Picker' on the toolbar.

If you can get it to load in VB 6.0 without the licence error, then you should be able to use it in Access w/o the licence error. I belive the license information in contained in the registry. I think there is a .reg file that you can run on the machine that will install the licence information in case it doesn't install correctly for whatever reason. Snaggs
tribesaddict@swbell.net
To define recursion, we must first define recursion.
 
Thanks for the info on where to find the control. I'll try it when I get home. I still am wondering what determines if a control is lisensed to be used. Can I assume if I don't get the message its OK and if so why does the message vary from system to system. I would think that my system at work would be more likely lisensed to use the control then my system at home.
 
Braindead2, I'm no lawyer but I know a couple of things about licensing issues.

First of all, license information is written to the registry when a licensed product is installed. If you were entitled to install the product, then you are entitled to all the rights granted by the license, of course.

ActiveX controls are a special case, though. They are generally purchased by software developers, who hold the actual license. But many controls are "redistributable", meaning that the software developer can include copies of it as part of his own product. That doesn't automatically give a license to the third party, the one who obtained it as part of an application software product.

Instead, Microsoft's license for redistributables allows the third party (the "end user") to use the control as part of the application software product, but not to use it for other purpose.

Yet the license info for the control has to be installed on the end user's computer in order for the control to work. In some cases, the license info installed on the end user's computer is different from that on the developer's computer, and the difference prevents the end user from using the control in Design mode. In other words, the control will function properly in terms of its runtime interface, but its design time interface is disabled. For such a control, you'll get a licensing error message if you try to drop it on a form.

But it's possible that a software developer could install the full license info on his users' computers, and I think sometimes this happens. The software developer who does so is on shaky legal ground, and the end user doesn't have license rights to use the control in his own development environment, even though he has the license info. You might be in this situation with respect to the Date/Time Picker control.

Or, you may have installed it as part of a development product you purchased from Microsoft, in which case you really do have the right to use it in design mode and to redistribute it yourself.

The only way to be sure is to review the documentation for each development product you have licensed from Microsoft, looking for a list of redistributable files. If you find it, you're jake. Otherwise, you're probably entitled to use it only as part of some other product. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top