5 Years
Discussion Span
Last Post by AndreRet

Try the following -

Text1.Text = dtPicker1.Value

rsAddNew!Date = Text1.Text

I know you have used the dtPicker to select a date. You must still do something with the returned value though. I have found that by calling the value when using a database tends to screw up from time to time, hence the text box value. You can also add the value to a variable -

Dim xDate As Date 'At the top of your code form

'Under your dtPicker_Click event
xDate = dtPicker.Value.
'Now use the code above to add the date to your table.

Have a look at your "ADODC" post, I gave a full on tutorial there.


thanks....can u plz tell me, when i press Add New Button, all fields will b clear, but i want to Dtpicker show the system date...how it will b?


Its a pleasure.:)

By using the code I gave you above.

Daclare a variable for the date at the TOP of your form -

Option Explicit

Dim xDate As Date

Private sub Command1_Click()
'All text boxes has been cleared...
xDate = dtPicker1.Value
'This will hold the variable until you clear it.

'After adding new record, use...
xDate = vbnullstring

i said that when a button is pressed, the dtpicker should show system date, which date is stored in my computer, dtpicker should show that one, then it should b user's choice,which one he is selecting..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.