Results 1 to 2 of 2

Thread: Need some help

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Phoenix, Arizona
    Posts
    2

    Post



    I am working with MSFlexGrid where the rows are: time intervals every 15 min increment, starting from the midnight ( 1 To 96 = rows) and the columns are dock#s 1 to 6 and 11 to 21
    This is what I have done:
    I have sub LoadGateData()in the module
    I have connection to sql
    Here are the lines of codes:
    Set g_objData = New PMServer.Receiving
    Set rsGates = g_objData.GetGateRecs(strDate)
    set g_objDaata = Nothing
    With MSFlexGrid1
    if rsGates.RecordCount > 0 Then
    rsGates.EOF = False
    .Col = Val(rsGates.Fields("DockID").Value)
    .Row = Val(rsGates.Fields("TimeInterval").Value)
    if Val(rsGates.Fields("CheckType").Value)= 1 Then
    .CellBackColor = vbGreen
    Else
    .cellBackColor = white

    These lines of code will color a single cell in the greed according to checkIN and checkOut (database table 1= checkin, 2=checkout) By the way, this is an appointment schedule.
    So, if the vehicle checks in the cell turns green color (currentTime and assigned Dock#, the dock# is also in database table)
    What I would like to happen:
    When the vehicle checks In from the current time to the entire time the whole column for the rest of the day should be colored in green until the vehicle checks out. And when the vehicle checks out from the time it checks out to the rest of the day the rows in the column should turn white until next check in, however the previously colored rows should be remain colored from the time check in to the time check out (exp. Dock#1 1:00 pm checked in and 3:00 pm checked out; 3:30pm checked in 4:30 pm checked out. From 00:00 to 1:00 pm= white; from 1:00 pm to 3:00 pm = green; from 3:30 pm to 4:30pm = green, and from 4:30pm to the end of the day = white.
    I also want to be able to program when a vehicle occupies particular dock# nobody else will be able to check in. And when the particular vehicle checked in the program will not allow him to check multiple times until he checks out.
    I know I can use array but I can't I have to come up with something else. Exp Time begining, Time left. If there is 4 rows in an hour than if current time is 2:00 am then four rown have to be white and 92 rows shaded. I kind of confused.

    Thank you
    Angela

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    I will take a look at this code and see if i can figure it out. You use a timer to check the status ever 15 min., right?
    or do you have events. Like a CheckOut event and a CheckIn event.
    Or is it done all at once?

    I think you will have do as you have, but loop through all the docks(rows) and set the colors, then move accross(column by column) and set the colors. Nested Loops is what you need. Maybe someone can give you refined code, but this is the general idea.

    by the way, enclose all future code it [code] and [/code]. (Forget the Bolds)

    See the FAQ
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

Posting Permissions

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



Click Here to Expand Forum to Full Width