Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2009
    Posts
    1

    Stoping Times disappearing

    I am trying to work with general date and wish to allways see the full date and time, but if i imput a date with the time of 00:00:00 it will only show the date part of it

    Does anyone know how to stop this??

  2. #2
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40
    Use the Now() function

    dim todaysdate
    todaysdate= Now()

    Debug.Print todaysdate

    On the Immediate screen you will have Data and time.

    Note : general date gives only the date part of the date/time data you give. Alter the above code as per your need.



    Happy to Help.
    reply back if u had asked for something else

  3. #3
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    set your field date format to what you want.

  4. #4
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40
    To marianne,
    The problem AJH1984 is facing, was faced even by me. Ideally if i use Format("todaysdate", General Date)...It has to give me both date and time...But will be giving only date, not the time.!!

  5. #5
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    what if format(date(),"mm/dd/yy hh:mm:ss") ?

  6. #6
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40

    Thumbs up

    I tried even this...in fact

    Const conJetDate = "\#mm\/dd\/yyyy\#"
    Format(Me.txtenddate, conJetDate)

    did work...but not if i add hh,mm,ss

    It would be helpful if you can modify the above code to suit this.

  7. #7
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150
    Const as in Constant. I have never used or tried using Const to equate to a certain format.

    doesnt it work to directly use it format(me.txtenddate,"mm/dd/yyyy hh:mm:ss") ???

  8. #8
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40

    Thumbs up Here's some code worked out...hope it clears some air

    Sub datecheck()
    Dim today As Date
    todaywithnow = Now()
    today = Format(today, "mm/dd/yyyy hh:mm:ss")
    Debug.Print today
    debu
    End Sub

    Sub datecheckwithnow()
    Dim todaywithnow
    todaywithnow = Now()
    Debug.Print todaywithnow
    End Sub

    Sub datecheckwithconst()
    Dim todaywithconst
    todaywithconst = Date
    Const conJetDate = "mm/dd/yyyy"
    todaywithconst = Format(todaywithconst, conJetDate)
    Debug.Print todaywithconst
    End Sub

    Call datecheck()
    12:00:00 AM


    Call datecheckwithnow()
    6/19/2009 10:39:02 AM


    Call datecheckwithconst()
    06/19/2009

  9. #9
    marianne is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Asia Pacific Region
    Posts
    150

    answer

    I am trying to work with general date and wish to allways see the full date and time, but if i imput a date with the time of 00:00:00 it will only show the date part of it

    Does anyone know how to stop this??

    ==========================

    I see that the problem relies on the field in the form not showing the full general date.

    i have created you this file. Is that what you've been looking?

  10. #10
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40

    Question Marie....another date problem...plz help

    Function IsDupeslam(cs1 As String, cs2 As String, cs3 As String, cs4 as date)

    Dim y As Integer
    cs4 = Format(cs4, "Short Date")
    y = DatePart("m", cs4)
    debug.print cs4
    debug.print y

    End Function

    debug.printt cs4 gives 12.01.01
    debug.print y gives 12

  11. #11
    Rameez is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2009
    Location
    Chennai, India
    Posts
    40
    Sub testdate(t1 As Date)
    Dim s As Integer
    t1 = Format(t1, "mm/dd/yy")
    Debug.Print t
    s = DatePart("m", t1)
    Debug.Print s
    End Sub

    Call testdate(06/19/2009)
    is giving 12

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 12-10-2018, 05:24 PM
  2. Replies: 2
    Last Post: 11-11-2008, 01:12 PM
  3. Replies: 0
    Last Post: 11-06-2008, 12:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums