Calendars

GJC

Registered User.
Local time
Today, 08:24
Joined
Mar 18, 2002
Messages
11
I am designing a form and wish to use calendar (MSCAL) to pick a date. As I have a number of date selection required, I have embedded 4 calendars into a 4 page tabed form.
Unforunately I cannot get the query to recognise the calendar in build criteria it spots the tabbed worksheet ok but not the calendar.
What am I doing wrong ?!!!
 
Add the selected date to an unbound text box and reference that.
HTH
 
Thanks Rich,

I am rather new to all this, How would I get the unbound text box to recognise the mscal object ?

Thanks again

G
 
Just got this from the MS support site
>>ACC97: ActiveX Controls Do Not Appear in the Expression Builder (Q170494)
--------------------------------------------
The information in this article applies to:
Microsoft Access 97
----------------------------------------
Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
When you try to reference the properties of an ActiveX control on a form from the Expression Builder, the properties of the ActiveX control do not appear in the list of available form controls.
CAUSE
ActiveX control properties do not appear in the Expression builder.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Open the sample database Northwind.mdb.
Create a form not based on any table or query in Design view.
On the Insert menu, click ActiveX Control.
Select Calendar Control in the "Select an ActiveX Control" list box, and then click OK.
In the ActiveX Control property box, select an event property, and then click the Build button to open the Expression Builder.
In the Expression Builder, note the controls that are available for the form you created in Step 2. The Calendar Control you created does not appear in the list <<

So I have been trying to do something I couldn't.
Does anyone have any tips on how I could get calendars onto a form which will allow dates to be picked

Cheers
 
Download "Solutions" from the same site, there is a working example which you can copy, see how it's done etc.
HTH
 
Rich,

Would you post the URL to the "solutions" download? I can't locate it.
 
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q190194

has a solution

I followed it diligently and get an error on the line

>>Calendar.Value = IIf(IsNull(OrderDate), Date, OrderDate.Value)<<

my line is

calendar.Value = IIf(IsNull(effectdate), Date, effectdate.Value)

Where effectDate is the name of my combobox.

I can't see any difference between the solution and my code. Am I missing something

thanks for all your help
 
Well I got it working in the "Northwind" test but I am having a couple of problems in the live database. I guess I am using the incorrect "names" when writing the code for the Mousedown and Click events. Probably cofusing the combobox and table field names (as in the example given in the solution they are both called Orderdate).
Does anyone have any ideas ?
 
I'm not sure what you are trying to do. Are you using date criteria in a query and trying to reference the calendar in the query? If so, do as Rich says. Create a hidden textbox on the same tab as the calendar. Set the control source for each textbox to =Forms!NameOfForm!NameOfCalendar.Value and reference this textbox in the query.

Let us know if I'm off base.
 
Basically, as a novice, I am following the exact instruction on the MS Support site (url a couple of postings ago)
however thier referencing does not appear to differentiate between field names in the table and the name of the combo box (as they have named them identically)
As such I can get the calendar to pop up just by clicking a combo box, when using the Northwind database but I am unable to transfer my newly found skill into my live database (60+ tables and over 1400 fields)
 
You seem to making a lot of work for yourself just to select a date for a query. The MS example OrderDate is the name of the combobox with the controlsource set to the OrderDate field from the Orders Table. Ideally they should have used cboOrderDate for combo, OrderDate for field. OrderDate in the code always refers to the name of the combo. Now you have to link the criteria for your date field in the query to the combobox on your form.

HTH
 
Yeah, I know its a lot of work but the end users are going to need it as simple as possible to use.

I changed a few things,
The Combo box control source is now pointing to !Table!Field, the remainder of the code in both the calendar and the combo box point to the combo box.

I get the message Run Time Error 2447
There is an invalid use of the .(dot) or ! operator or invalid parenthesis
You may have entered an invalid identifier or typed parentheses following a null constant.

The highlighted section in debug is.
calendar.Value = IIf(IsNull(effectdate), Date, effectdate.Value)
I got this in the test database but fixed it by changing the control source to just the name as opposed to the =!table!field bit.
But when I do this I get another run time error telling me The expression you entered has a field , control or Property name that access cnnot find (Run time 2424)


This is the code
effectdate is the combo name

Private Sub effectdate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'show Calendar and set its date.
calendar.Visible = True
calendar.SetFocus
'Set to today if effectdate has no value.
calendar.Value = IIf(IsNull(effectdate), Date, effectdate.Value)
End Sub

At the end of my tether !!!
 
I have a working calender to where you just double click the date field you want to insert the date. Email me if anyone wants it. Its 2 moduals and 1 form

akolln@srt.com

Alan
 

Users who are viewing this thread

Back
Top Bottom