Is it possible to restrict only to select dates on a textbox? (1 Viewer)

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 16:20
Joined
Mar 22, 2009
Messages
787
I don't want to let the users to enter dates but only to select. How to do it?
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:50
Joined
Sep 21, 2011
Messages
14,378
Select one date?, multiple dates?

If one use a combo box, ir more than one, use a multi select listbox

Populate the control from where ever you keep your dates.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:50
Joined
May 7, 2009
Messages
19,246
on design view of your form, click on the textbox control.
on the Property Sheet->Format->Short Date

go to Event tab of the Property Sheet and select Keypress event. on the vbe

Private Sub yourTextboxName_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:50
Joined
Sep 21, 2011
Messages
14,378
on design view of your form, click on the textbox control.
on the Property Sheet->Format->Short Date

go to Event tab of the Property Sheet and select Keypress event. on the vbe

Private Sub yourTextboxName_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

For my benefit please?

Wouldn't be easier to just lock the control for that effect?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:50
Joined
May 7, 2009
Messages
19,246
i tried locking the control, put it wouldn't insert the date from the pop-up calendar.
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:50
Joined
Sep 21, 2011
Messages
14,378
i tried locking the control, put it wouldn't insert the date from the pop-up calendar.

Ah I see, I have no access to the DB, so did not realise he was using a calendar control.

Thank you.
 

BlueIshDan

☠
Local time
Today, 07:50
Joined
May 15, 2014
Messages
1,122
Select Pre-Existing dates within your database's records. or
Select from a date-time picker?
 

Users who are viewing this thread

Top Bottom