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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time Error '6' Overflow

Status
Not open for further replies.

odessa79

Programmer
Sep 16, 2003
31
US
Hi,
I got a problem am tring to convert this date field and am getting this error message. Please help

Dim fldRequestReceiptDate As ADODB.Field
Const DATEFORMAT = "MM/DD/YYYY"

txtRequestReceiptDate.Text = Format(fldRequestReceiptDate, DATEFORMAT)

Or is there a way to conver this textbox differently?
 
Try
Code:
   txtRequestReceiptDate.Text = _
      Format(cDate(fldRequestReceiptDate.Value),  DATEFORMAT)
I'm assuming that you have properly assigned an ADODB.Field object to "fldRequestReceiptDate".
 
Now am getting type mismatch error 13. What could that be?
I am pulling data out of the fldRequestReceiptDate field in yyyymmdd format
 
If Your date value is comming over as a number (20031009) or string ("20031009") then it may not be recognized by the date function. In other words it does not know how to convert it into a date.

How is the value stored in the database, Date, string or number? If the format is always the same you may be able to write your owm function to add the slashes (/) in the correct place so that it will be recognized. Or change the way the date is stored in the database. Store it as a date and always hold it in 'date' type variables.

Thanks and Good Luck!

zemp
 
zemp ... Good catch. I was just assuming that the field value must be something that cDate would be able to handle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top