add date from calendar

how do i modify the code to get it working?
Well, now that I know it's a mouse event and the control is likely on the subform, my comment doesn't apply.
I will let the dbg download your file as I think he's way ahead of me on this.
 
Heres a basic example of the issue.
open frmpersonnel_sub_history, code works fine.
open frmpersonnel where "frmpersonnel_sub_history" is embedded as a subform and it doesnt.
Hi. I finally got in front of a computer and was able to download your file. It seems this is a limitation of the RunCommand method. What I did to test this is add a button on your subform with the following Click event.
Code:
Private Sub Command1_Click()

Me.fld_Date_trec.SetFocus
DoCmd.RunCommand acCmdShowDatePicker

End Sub
And just like your MouseUp event, this works fine on a standalone form but gets a "not available now" error when used on a subform. I will have to pass this on to the Access Team and see what they say about it. Sorry, I couldn't really help.
 
Hi. I finally got in front of a computer and was able to download your file. It seems this is a limitation of the RunCommand method. What I did to test this is add a button on your subform with the following Click event.
Code:
Private Sub Command1_Click()

Me.fld_Date_trec.SetFocus
DoCmd.RunCommand acCmdShowDatePicker

End Sub
And just like your MouseUp event, this works fine on a standalone form but gets a "not available now" error when used on a subform. I will have to pass this on to the Access Team and see what they say about it. Sorry, I couldn't really help.
Hi. So far, I have only heard back from one MVP, and he recommends using a custom date picker. I have used Allen Browne's Popup Calendar before, but I know there are other examples in the Sample Databases section of this forum. Cheers!
 
Hi. So far, I have only heard back from one MVP, and he recommends using a custom date picker. I have used Allen Browne's Popup Calendar before, but I know there are other examples in the Sample Databases section of this forum. Cheers!
Okay, I just received word from MS. This is an old issue but was never fixed. MS will look into it and hopefully get it fixed. Here's the explanation:

Basically, there are two categories for the commands executed by the RunCommand method. Show Date Picker seems to be in the wrong category.

For now, the recommended workaround is to use SendKeys.

Code:
Me.ControlName.SetFocus
SendKeys "%{Down}"

Hope that helps...
 
theDBguy said:
...MS will look into it and hopefully get it fixed...

Right...like they've fixed the age old bug where using the aforementioned SendKeys turns off the Numlock key!

Don't think I'll hold my breath.

Linq ;0)>
 
Right...like they've fixed the age old bug where using the aforementioned SendKeys turns off the Numlock key!

Don't think I'll hold my breath.

Linq ;0)>
Guess I should have said:"I am hoping it will get fixed."
 
Okay, I just received word from MS. This is an old issue but was never fixed. MS will look into it and hopefully get it fixed. Here's the explanation:

Basically, there are two categories for the commands executed by the RunCommand method. Show Date Picker seems to be in the wrong category.

For now, the recommended workaround is to use SendKeys.

Code:
Me.ControlName.SetFocus
SendKeys "%{Down}"

Hope that helps...

so i can use sendkeys as a workaround to get the date picker to open? if so, how? (never used send keys).
if ive misunderstood and a custom date picker is the only way then thanks for your help but i wont bother. its nice to have but not worth "that much" effort.
 
if ive misunderstood and a custom date picker is the only way then thanks for your help but i wont bother. its nice to have but not worth "that much" effort.
For most of these custom controls "there is no effort". You drop the code / form into your application and usually requires one line of code to use.
 
so i can use sendkeys as a workaround to get the date picker to open? if so, how? (never used send keys).
if ive misunderstood and a custom date picker is the only way then thanks for your help but i wont bother. its nice to have but not worth "that much" effort.
Hi. I gave you the "how" in my post. Did you try it and it didn't work?
 

Users who are viewing this thread

Back
Top Bottom