"Kou Vang" <(E-Mail Removed)> wrote in message
news:0612E285-43E7-4F60-B8C9-(E-Mail Removed)
> I have 2 fields, a date and a time. How do I get them into the CDbl(
> ) formula? The CDbl wants it to be: CDbl(#date#). I keep getting
> type mismatch when I try to use my value in my textbox. So I want to
> get this:
>
> txtDate = 11/1/2005
> txtTime= 2:00:00 PM
>
> CDbl(txtDate & txtTime)= numeric value from date and time
>
> But I can't get the Date and Time into a correct format to use the
> formulas. Thanks!
Are txtDate and txtTime text fields? If so, you'll have to convert them
into Date fields first. You could do this:
x = CDbl(CDate(txtDate & " " & txtTime))
or this:
x = CDbl(CDate(txtDate) + CDate(txtTime))
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)