Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Picker Please help!!!!

Status
Not open for further replies.

lucyv

Programmer
Mar 11, 2002
152
0
0
US
Can anyone please help me. I am trying to assign a date from my database to a date picker control. I tried
DatePickerName.value = rs.fields("fldBeginDate").value
but the date remains the same. Please help!
Thank You!!!
 
Make sure your dtabase date format and the DTPicker format are the same.

Is it throwing an error or just not working?

chadt@techtnologies.com
 
Are you using DAO?

Try This....

Set rs = db.OpenRecordset("TableName",dbOpenDynaset)
With rs
DTPicker1.Value = !fldBeginDate
End With
rs.Close
Set rs=Nothing

Note:

If you are trying to find a specific Date to load to the DatePicker Control... Try to query before loading it to the control.[bigsmile]

 
Does rs.fields("fldBeginDate").value contain a legitimate date format?

Try
=CDate(rs.fields("fldBeginDate").value)
or
=DateValue(rs.fields("fldBeginDate").value)

If this doesn't work then I would say that the field doesn't contain a date, or that other code following this code (in the same proceedure or in a event somewhere else) is causing another change to the set value or defaulting back.
 
Thank You everyone for your help! It works fine now.
Thank You Again!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top