Results 1 to 5 of 5

Thread: Formatting (XP)

  1. #1
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting (XP)

    Hi,

    I have a query which lists all the hours in a day. The [ Time] field is an Integer type, as I only need to list hours and this helps with oth calculations I have to do etc.
    I am displaying this is a form and have been using the Format property for the [ Time] textfield like this to give a 'time' representation:

    <font color=blue>00":00"</font color=blue>

    this gives a nice 01:00, 02:00 etc.

    How could i get the following: 01:00 - 02:00, 02:00 - 03:00

    I have tried things like setting the control source to

    <font color=blue>Format([ Time],"00") & ":00 - " & Format([ Time]+1,"00") & ":00"</font color=blue>

    and tried playing with the Format field but to no avail. I know I can sort this by having the [ Time] field do this on the query ( i think), but is there a way of doing this type of calculation/formatting in the form? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    (added a space in [ Time] to stop the big hourglasses [img]/forums/images/smilies/wink.gif[/img] )
    Thanks,

    pmatz

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting (XP)

    The expression itself looks OK, make sure that the control source begins with =

    BTW apart from the problem with the hourglass smiley, Time is not a very good name for a field, since it is also a VBA function.

  3. #3
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting (XP)

    HehHeh, its about time I made sure i didn't name fields after function etc!

    Starnge thing, I had to delete the text field and add a new one and set the control source, because I kept getting an error on the other one - oh well. Cheers <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Thanks,

    pmatz

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting (XP)

    But does it work now?

  5. #5
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting (XP)

    Sorry Hans. YES <img src=/S/grin.gif border=0 alt=grin width=15 height=15> it does work now. It works wonderully, I had to make sure that the Name property was different to the [field] that i was using in the ControlSource expression as this confused access i think. But yes, working AOK now.

    Just read a post of yours and some help on the FormatConditions code which is cool. helping me to set these through VBA to 'save time'.

    thanks again
    Thanks,

    pmatz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •