471,316 Members | 1,059 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

Access Calendar

rcollins
234 100+
I have a calendar on my form that inputs the date selected. Right now, the date isn't updated until I click on the date box after selecting the date. Is there a way for me to update as I click on the date>
Dec 21 '06 #1
16 3486
MMcCarthy
14,534 Expert Mod 8TB
I have a calendar on my form that inputs the date selected. Right now, the date isn't updated until I click on the date box after selecting the date. Is there a way for me to update as I click on the date>
In the after update event of the calendar object put a requery on the textbox

Expand|Select|Wrap|Line Numbers
  1. Me.textBoxName.Requery
Mary
Dec 21 '06 #2
rcollins
234 100+
I tried this and it made no difference. Is it because the calendar has On Updated rather than After Update?
Dec 22 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
I tried this and it made no difference. Is it because the calendar has On Updated rather than After Update?
Try the on click event instead
Dec 22 '06 #4
Killer42
8,435 Expert 8TB
Try the on click event instead
Hi Mary.

Is that version dependent? I just had a look at the Calendar Control 8.0 under Access 2000, and the only events it seems to have are:
  • On Updated
  • On Enter
  • On Exit
  • On Got Focus
  • On Lost Ficus
Would this be because I'm on an old version? Or perhaps some of the events aren't listed in the properties box?
Dec 27 '06 #5
willakawill
1,646 1GB
Hi Mary.

Is that version dependent? I just had a look at the Calendar Control 8.0 under Access 2000, and the only events it seems to have are:
  • On Updated
  • On Enter
  • On Exit
  • On Got Focus
  • On Lost Ficus
Would this be because I'm on an old version? Or perhaps some of the events aren't listed in the properties box?
You are only looking at the property list. All of the normal events can be handled in a code module including the click event
Dec 27 '06 #6
Killer42
8,435 Expert 8TB
You are only looking at the property list. All of the normal events can be handled in a code module including the click event
Thanks Will, I'll have to try and remember that. Sometimes the differences between "real" VB and VBA can be frustrating.
Dec 27 '06 #7
tm2
4
Would someone explain in a "Dummy" format how to accomplish this? I understand how to program events (in VBA, that is), or at least I thought I did. I wish to requery a list control once the Calendar control has been changed. I saw a post where the events can still be programmed even if they are not available in the property list. Please provide more info.

Thanks
Jan 29 '07 #8
missinglinq
3,532 Expert 2GB
Don't have a clue why Access only lists some of the events for comboboxes in the Property Box! To gain access to the others you need to go into the code Editor for your form. At the top are two dropdown boxes. When you initially enter the editor the lefthand box will say "General" and the righthand one will say "Declarations."

Go into the lefthand box and scroll down to the name of the combobox. Once this is selected drop down the righthand box, where find all of the related events, and scroll down to whatever event your interested in. This will take you to the appropriate sub, or somewhere close to it! Doesn't always land right on the mark, so check the name of the sub! This is also how you can quickly navigate to a particular sub within the form's code module.
Jan 29 '07 #9
Killer42
8,435 Expert 8TB
...This will take you to the appropriate sub, or somewhere close to it! Doesn't always land right on the mark, so check the name of the sub!
Excellent advice, linq. But the highlighted part worries me. Are you saying that your VB sometimes shows the wrong sub?! How can that be?
Jan 29 '07 #10
tm2
4
OHH! That's neat! But you know what's puzzling? I have an ActiveX Calendar control on my form. When a different date is selected, I want a list box to requery without having to move off of the calendar control. How can I capture the "change" of selected date?

[Private Sub CalDate_Click()
Me.CurList.Requery
End Sub]

This doesn't work...
Jan 29 '07 #11
rcollins
234 100+
so i realy apreciate all of the input. I still am learning more with each reply. Which one of these would make my date text box equal what is active on the calendar?
Here are My choices for the calendar
[code]
After Update
Before Update
Click
Double Click Enter
Exit
Got Focus
Key Down
Key Press
Key Up
Lost Focus
New Month
New Year
Updated
[/CODE
Jan 29 '07 #12
Killer42
8,435 Expert 8TB
so i realy apreciate all of the input. I still am learning more with each reply. Which one of these would make my date text box equal what is active on the calendar?
Here are My choices for the calendar
Expand|Select|Wrap|Line Numbers
  1. After Update
  2. Before Update
  3. Click
  4. Double Click Enter
  5. Exit
  6. Got Focus
  7. Key Down
  8. Key Press 
  9. Key Up
  10. Lost Focus
  11. New Month
  12. New Year
  13. Updated
  14.  
You could research it by placing some code in each event to display the value in the calendar control (and the name of the event, of course). As soon as you find the event which fires at the right time and shows the right value, that's the one you want. Then just place the code there to populate the textbox.
Jan 29 '07 #13
Killer42
8,435 Expert 8TB
OHH! That's neat! But you know what's puzzling? I have an ActiveX Calendar control on my form. When a different date is selected, I want a list box to requery without having to move off of the calendar control. How can I capture the "change" of selected date?
Expand|Select|Wrap|Line Numbers
  1. Private Sub CalDate_Click()
  2. Me.CurList.Requery
  3. End Sub
What's the source of the listbox items? Perhaps it's being repopulated with the same list.
Jan 29 '07 #14
tm2
4
What's the source of the listbox items? Perhaps it's being repopulated with the same list.

The Source is SQL statement which pulls info based on the date selected in current form. The date has to be selected first before the list is populated.
Jan 29 '07 #15
Killer42
8,435 Expert 8TB
The Source is SQL statement which pulls info based on the date selected in current form. The date has to be selected first before the list is populated.
Ok. But can you give us more detail on exactly what doesn't work? For instance, does the Click event fire when you expect? And if so, does the calendar show the value you expect?
Jan 29 '07 #16
tm2
4
The Source is SQL statement which pulls info based on the date selected in current form. The date has to be selected first before the list is populated.
I got it! It's the little things that get me sometimes...
I had to "Refresh" the form before the list "Requery". It works perfectly now.

Thanks, Killer!
Jan 29 '07 #17

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Michael Holberton | last post: by
1 post views Thread by Adonis Walmsley-McCarthy | last post: by
1 post views Thread by Andy Davis | last post: by
3 posts views Thread by Hutty | last post: by
7 posts views Thread by Mike Charney | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.