Dick7Access
Dick S
- Local time
- Today, 09:19
- Joined
- Jun 9, 2009
- Messages
- 4,243
Is there a way to have the date picker show always, without having to click on the date control?
...but I don't think you can have it always displayed. (Not the built-in control anyhow.)In the control's On Got Focus event place this code:Code:DoCmd.RunCommand acCmdShowDatePicker
You can have the date picker pop up automatically when the control is selected:
...but I don't think you can have it always displayed. (Not the built-in control anyhow.)
I was trying to make it idiot proof.
When they hit new record button I have it go to the date control and the date picker shows up, but I was trying to make it idiot proof. I also put a label under the control that says, "click in the white to bring up calendar."
Private Sub YourDateField_GotFocus()
DoCmd.RunCommand acCmdShowDatePicker
End Sub
That doesn't sound as if you have the DatePicker actually opening, when the Control is entered, which is what ashleedawg's code would do. As he suggested, using
Code:Private Sub YourDateField_GotFocus() DoCmd.RunCommand acCmdShowDatePicker End Sub
will automatically popup the DatePicker, when the Control is entered, without the user doing anything. Don't know how much more idiot-proofing you could do. OF course, the problem with idiot-proofing anything is that idiots are so darn ingenious!
Linq ;0)>
...How do I make it not accept a used date? I need only one record per date...
Private Sub YourDateField_BeforeUpdate(Cancel As Integer)
If DCount("*", "YourTableName", "YourDateField = #" & Me.YourDateField & "#") > 0 Then
Cancel = True
MsgBox "There is Already a Record for this Date! Please Pick Another Date"
Me.YourDateField.Undo
End If
End Sub
Private Sub diaryDate_AfterUpdate()
DoCmd.GoToControl "diaryData"
End Sub
Private Sub cmdFindMonth_Click()
DoCmd.ApplyFilter "qryFindMonth"
DoCmd.OpenForm "frmEveningClutter", acFormDS ' Opens form in datasheet view
Me.cmdAll.Enabled = False
Me.cmdNew2.Enabled = False
End Sub
if len(me.txtDateControl & "") <1 then
msgbox "Date is missing"
me.txtDateControl.setfocus
exit function
endif