Results 1 to 2 of 2
  1. #1
    terryvanduzee is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    17

    Conditional number format

    Hello



    I have a form where I enter work time and travel.
    There are work codes that determine the charge for the work: 717 is for the distance travelled (in Km(s)). All other charges/codes are for hrs of work performed (Hr(s)).

    I am trying to format the "Time Billed" field based on the work code.
    If the work code is 717 then the format should be "0.00 Km(s)" otherwise the format will be "0.00 Hr(s)".

    Any suggestions?

    Thank You
    Terry

  2. #2
    Rod is offline Expert
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Here's one way:

    Code:
     
    Private Sub txtWorkCode_AfterUpdate()
    Select Case Me.txtWorkCode
    Case 717
    Me.txtBilled.Format = "#,##0.00 Km(s)"
    Case Else
    Me.txtBilled.Format = "#,##0.00 Hr(s)"
    End Select
    End Sub
    Use your own field names of course.

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

Similar Threads

  1. Ordinal Number Format
    By injanib in forum Forms
    Replies: 2
    Last Post: 06-15-2011, 01:55 PM
  2. conditional format problem in access
    By bold01 in forum Access
    Replies: 2
    Last Post: 02-10-2011, 11:35 AM
  3. Conditional format for Null date
    By azaz in forum Forms
    Replies: 1
    Last Post: 12-27-2010, 03:11 AM
  4. Advanced Report Conditional Format
    By MrHoliday in forum Forms
    Replies: 2
    Last Post: 08-25-2010, 11:58 PM
  5. Conditional Format Query
    By Schwagr in forum Queries
    Replies: 3
    Last Post: 03-20-2006, 02:39 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