Format of a textbox on a user form controled by a spinner

J

Jeff

I am trying to build a form with a date in a text box
controled by a spinner. I am able to place the spinner
and the text box, but cannot make the format of a date
show in the text box. All I can get is the number to show
in the text box. i.e. 37872 is today.
thanks in advance
Jeff
 
T

Tom Ogilvy

Private Sub Spinner1_SpinUp()
Dim dDate as Date

dDate = cDate(Textbox1.Text)
dDate = dDate + 1
Textbox1.Text = Format(dDate,"mm/dd/yyyy")
End Sub

Private Sub Spinner1_SpinDown()
Dim dDate as Date

dDate = cDate(Textbox1.Text)
dDate = dDate - 1
Textbox1.Text = Format(dDate,"mm/dd/yyyy")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top