form not refreshing

shutzy

Registered User.
Local time
Today, 13:28
Joined
Sep 14, 2011
Messages
775
i have had a diary built for me. it displays all the days appointments or any day that you select. i have on the diary a tx box with date. below that i have day selectors and week selectors. these work fine. but if i want to move to the next month i use the date selector that is built in to access. i click the txt box with the date in and it appears to the right of the text box. on selecting the date i would like the correct info to be displayed. i have done most of this and it nearly works flawlessly. the only thing is that is does not fully display the days appointments until i click anywhere else on the form.

i have tried to add a set focus but this does not seem to work. i have also added

Me.chTreatment.Value=true.

to toggle the check box on the form to hopefully do what the click anywhere seems to do.

i dont really know how to overcome this.

i have added a version of my database for anyone to help


the way i have been testing is to
open database
click Diary button
then use the right arrow to the left of the form to navigate to tomorrow. then i use the calendar to select today.

you will notice that not all of the appointments are showing. then click anywhere on the screen and then they will show. its strange.

thanks
 

Attachments

.. but if i want to move to the next month i use the date selector that is built in to access. i click the txt box with the date in and it appears to the right of the text box. on selecting the date i would like the correct info to be displayed. i have done most of this and it nearly works flawlessly. the only thing is that is does not fully display the days appointments until i click anywhere else on the form.
....
Hmm - when I click in the textbox with the date, nothing happen, no date selector is shown! But there is also NO click event insert for the textbox, see attached picture.
 

Attachments

  • NoClickEvent.jpg
    NoClickEvent.jpg
    81.8 KB · Views: 80
there is not meant to be a click event. the date selector is the built in fuction of access. the little calendar that shows up when you click on a date field/txt box. this fuctionality can be disabled but the default is enabled.

edit.
sorry its called the date picker. the option is in the Format tab of the txt box
 
Last edited:
Ok - I downloaded the database again, then the date picker was there.
Try the below code:
Code:
Private Sub txtApptmntDate_Change()
DoCmd.Echo False
Me.Text38.SetFocus
getEmployeeAvailability
primeEmployees
Call Refreshform
Me.Recalc
Me.txtApptmntDate.SetFocus
DoCmd.Echo True
End Sub
 
thanks. it worked a treat. however i have always been looking for a replacement for calendar control. i have found one. the only thing is that i cant get the txt date box to update the diary again!!!

i have got the calendar to update the date box but thats it. there must be an event or some method of getting this to work.

can you help me out on this please!!

ive uploaded an updated version
 

Attachments

i have got the calendar to update the date box but thats it. there must be an event or some method of getting this to work.
Where you get the date box updated, is a good place to run you code from, then the date box event isn't fired, only because you change the value in it from code.
 

Users who are viewing this thread

Back
Top Bottom