[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Load Calendar value with current date on form open and change with user selection

Posted on 2007-10-18
5
Medium Priority
?
548 Views
Last Modified: 2013-11-28
I have a form with an ActiveX Calendar12 object. In control source for the object I have..."=Date()". When my form opens the calendar object loads with the current date like I want it to. I want the user to be able to pick another date and have the value of the object be this new date. As it stands now you cannot select another date and the value is always the current date.
Thanks for the help!
0
Comment
Question by:IronDriver
5 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 20103180
0
 
LVL 61

Expert Comment

by:mbizup
ID: 20103188
remove the = Date() from the control source.
Put Date() into the Default value of the field, or of the calendar control itself.

The user should then be able to select a date.
0
 
LVL 4

Expert Comment

by:dan_vella
ID: 20103344
If you have no luck finding the default value for the calendar control, remove the control source AND use an On Open Event procedure for the form, this is how I have got aroung this in the past:

Private Sub Form_Open(Cancel As Integer)

Me.Calendar0.Value = Date

End Sub

0
 
LVL 4

Expert Comment

by:dan_vella
ID: 20104469
sorry that should be:Private Sub Form_Open(Cancel As Integer)

Me.Calendar0.Value = Date()

End Sub
0
 

Author Comment

by:IronDriver
ID: 20108813
Curious thing here...I know both capricorn1 and dan's suggestions are effective. I looked at cap's file and is a nice solution. I tried to use dan's code in my current project and cannot get it to work. Yet if I open a new db and build a simple form with just the calendar object and the code it works exactly as I would like. I obviously have something causing the issue in my VB code but haven't found it yet.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

830 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