+ Reply to Thread
Results 1 to 5 of 5

Set Combo Box Automaticly Show Time

  1. #1
    Registered User
    Join Date
    08-18-2007
    Posts
    62

    Question Set Combo Box Automaticly Show Time

    I have a data entry form with several objects; one of them is a combo box where the user chooses a time frame.
    How can I change the caption on a combo box (cboTime) were the options are ;
    6:30 AM
    8:45 AM
    12:00 Pm
    2:30 PM
    The time needs to be entered but we only worry about this time frame. I would like to use the computer, Windows, or Excel clock time to set this combo box time frame, make it change automaticly, so when is 7:45, the combo box will display 6:30 AM, when it 3:45, will show 2:30 PM, ect..

    This is the code for the Initialization of the from comb obox
    Please Login or Register  to view this content.
    When you have a data input form in a production line, any click savings is very valuable, 2 clicks, 3 click, it keeps accumulating user input valuable time!
    I’m trying to save one here by setting this combo box automatically to save a click!

    Any input is greatly appreciated
    Last edited by VBA Noob; 09-29-2007 at 04:37 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You have four times in your combobox - note you are creating strings this way. The current time will not be one of those times so what will you achieve? You can try this

    place three comboboxes on a userform then add this code

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    08-18-2007
    Posts
    62
    Roy thanks for your suggestion I got the idea.
    I think the best way to approach this is just put a label or textbox showing time, and when the time is entered in this column just format the font so when is 6:30 AM, 8:45 AM, 12:00 PM, 2:45 PM… the font will turn red bold. This way with only less than 50 data entry a day, the red bolt font will distinctively show what units were entered between these times frame.
    So now I got 2 problems;
    When I got a Textbox showing the time, capturing and entering in to the sheet column “R”, Excel wont let me do more than 3 conditionally formats. How can I with an expression put the 4 time frames in one formatting entry?
    My second problem is the reason I decided at the beginning to use the combo box so the User knowing what time it is will choose the time frames. So now if I capture the system time and is let say 6:55, and if conditionally formatted to turn red bold it wont, because is not 6:45. How can I conditionally format with and expression (or code) so when in column “R” the time closes after 6:30 AM. 8:45, 12:00 PM, 2:45 PM, turn red bold?

    Thanks guys!

  4. #4
    Registered User
    Join Date
    08-18-2007
    Posts
    62

    Bump

    Any ideas? input? suggestions?

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    If you are trying to put the current time into the bands howabout this.

    B4: 6:30
    B5: 8:45
    B6: 12:00
    B7: 14:45
    Format B4:B7 custom, h:mm for visual purposes.

    D2: =TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
    Again put in the custom format.

    E2: =VLOOKUP(D2,B2:B5,1)
    Again with the custom format.

    This should give you the block that is relevant to the current time.

    HTH

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1