Solved

Calendar in SubForm

Posted on 2011-03-01
12
580 Views
Last Modified: 2012-05-11
I am trying to implement a calendar via a subform. I found this demo on the msdn. However I don't want the text box to be updated when the Month and Year increment and decrement buttons are pressed. I only want to update the text box when the date is actually clicked. I am not sure what I need to modify to fix this.
CalendarDemo.zip
0
Comment
Question by:threeieng
  • 6
  • 4
  • 2
12 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
0
 

Author Comment

by:threeieng
Comment Utility
This will be used in Access 2010 so it cannot use the Calendar Control since its not supported in 2010.
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
it really helps when you give all the information in the original post.
saves time and effort
0
 

Author Comment

by:threeieng
Comment Utility
Sorry for leaving that out.  I asked what needs to be modified in the uploaded database so I didn't think Access version was important.
0
 
LVL 10

Expert Comment

by:conagraman
Comment Utility
threeieng-

just delete the arrow buttons on the formCalendar
0
 
LVL 10

Expert Comment

by:conagraman
Comment Utility
here is your database. i did a couple things to it

like i said before i deleted the arrows but i also got rid of the list box and set the properties of the date textbox to:
enabled =false
locked = true
i did this to keep the default calendar from poping up

in the calendar form i set the key down event to
keycode = 0
this way the user will have to click on the date


CalendarDemo.mdb
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 10

Expert Comment

by:conagraman
Comment Utility
i guess thats what you want to do?
0
 

Author Comment

by:threeieng
Comment Utility
The user will still need to ability to increment or decrement the month and year though.
0
 
LVL 10

Expert Comment

by:conagraman
Comment Utility
threeieng

the answer to your question is your current calendar in your uploaded database can not be modified to do what you want it to do.

what i have found is that you will need to use a different calendar. this calendar will not function the way you want it to.  you would need to be able to access the onclick event of the form frmCalendar. if you put code into the onclick event of your current calendar it wont get fired because every control already has an onclick event.

keep in mind when you click in your birthday textbox the little built in calendar will pop up and acts like you have described. just giving you an option.
im sure there are other calendars out there that will work.
0
 
LVL 10

Accepted Solution

by:
conagraman earned 500 total points
Comment Utility
wait i take that all back : ) i got it


ok i added a global integer variable "wasClicked"
 in the handleselected function i set that variable "wasClicked" to =1
last in the calendarForm_DateChanged sub i put an if then statement.


yea!...


CalendarDemo.mdb
0
 

Author Closing Comment

by:threeieng
Comment Utility
Thank you very much for going the extra mile conagraman!!
0
 
LVL 10

Expert Comment

by:conagraman
Comment Utility
: )
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now