Results 1 to 23 of 23

Thread: Dynamic table?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Dynamic table?

    Hi,

    I'm in the process of a new project & need some advice to help me get started. Hopefully I will explain the idea well enough, if not please let me know.

    There will be 14 Rows & 9 Columns. Each row is relative, which I hope to explain further down.

    A small diagram is attached (very brief & not full scale!) to give you an idea of what I have in mind.

    Bonus - If one is selected it will highlight (amber) that row (Doesn't highlight the last cell. Disabling all the bonus 'optionbuttons'.

    Low - If selected it will highlight that cell (not the row or column) in green & add a minus (-) to the end of the number (the number entered was 200, would then be 200-)

    High - If selected it will highlight that cell (not the row or column) in green & add a plus (+) to the end of the number (the number entered was 200, would then be 200+)

    Each cell in the same row is relative to all cells (apart from the final cell). If R1/C1 is 100 & is selected 'High', then R1/C2 would need to be greater then 100. Alert, if I tried to enter 99 or lower in R1/C2. Alert, If I tried to enter 99 or lower in R1/C7 etc.

    The final Column (C9) is relative to the entire row. If a number is entered it will highlight that cell in red (not row or column). If R6/C9 is 800- then all cells in that row (R6) must be lower then 800. Alert, if I try to enter 799 or lower in any of the cells in R6.

    Any idea's, suggestions & advice is much appreciated as I simply don't know how best to approach this project. I know some VB6, not much & its been a few months since I used it last.

    Cheers,
    Guy M
    Attached Images Attached Images  
    Last edited by Guy M; Apr 2nd, 2010 at 07:11 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Dynamic table?

    Are you really doing this in VB6 or Excel?

    If VB6, what database are you using for the table?

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    Quote Originally Posted by Hack View Post
    Are you really doing this in VB6 or Excel?

    If VB6, what database are you using for the table?
    I hope to do it in VB6, but I have no idea where to start. I was tempted & still am to do it in Excel as it will be alot easier (I assume).

    I will be entering all the data myself. Its not being imported or anything complicated, no database.

    Cheers,
    Guy M

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Dynamic table?

    If you aren't going to use database tables for this, then I don't see how you could not do it in Excel and still hope to maintain your sanity.

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    Quote Originally Posted by Hack View Post
    If you aren't going to use database tables for this, then I don't see how you could not do it in Excel and still hope to maintain your sanity.
    Perhaps I'll stick to Excel then, cheers for the tip

  6. #6
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Guy

    Before getting into the logic (the processing flow) ...
    when you say "14 rows and 9 cols" -- this is a little ambiguous.

    I see several options -- rows and cols refer to:
    1. an Excel worksheet
    2. a MSFlexGrid on your VB6 form
    3. something else


    Do you know which way you want to go?

    Spoo

  7. #7
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Dynamic table?

    Quote Originally Posted by Spoo View Post
    Guy

    Before getting into the logic (the processing flow) ...
    when you say "14 rows and 9 cols" -- this is a little ambiguous.

    I see several options -- rows and cols refer to:
    1. an Excel worksheet
    2. a MSFlexGrid on your VB6 form
    3. something else


    Do you know which way you want to go?

    Spoo
    I think he is saying about the Worksheets in EXCEL.

    Also, it's VBA (not VB6). So, I think this thread is more suited in Office Development Section

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  8. #8
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    akhil

    OK.. we'll see soon enough, I guess

    Spoo

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    I hope to create (if possible) this in VB6, but I might have to give into my lack of knowledge & opt for simple Excel formula's & not use VB6 at all.

    I considered MSFlexGrid, but that doesn't give me any space to add any optionbuttons for selecting bonus, low & high next to each cell. I thought the best way (probably the wrong way) was to use TextBox's & form a sort of "Row & Cell" layout.

    Maybe I need to create the idea in photoshop in more detail & give a little more understanding of how I want it to look & what I want it to do.

  10. #10
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Quote Originally Posted by Guy M View Post
    Maybe I need to create the idea in photoshop in more detail & give a little more understanding of how I want it to look & what I want it to do.
    Guy

    That would be helpful.

    And I'd offer that we seem to have established that this is
    the proper Forum for you -- VB6.

    Spoo

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Dynamic table?

    If this thread needs to be moved once decided upon the language, just let us know and we can move it if needed.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    This is how (not exactly) I envisaged it looking. I will make it a little more minimalistic (L & H instead of low & high etc...). Hopefully that will give you a better idea of how it would look & how it would hopefully work.

    I first enter 14 numbers (0-999) into the first column of each row. When I get a suggestion of low/high, I will then select that option to add a -/+ to the end of the number.

    The reason for the -/+ is so the next cell would have to be lower or higher then the previous. Perhaps it doesn't need to add a -/+. If R1/C1 is 100+ then all R1's cells must be greater then 100.

    If I locate the bonus I will highlight the entire row's cell (amber). It would also disable all the other bonus option buttons.

    The final column is another suggestion. Either lower or higher. It works in the same way, R1/C9 is 200- then all R1's cells must be lower then 200.



    I hope that is a little easier to understand. If you need me to explain it in further detail I will.

    Thanks for the reply

    Cheers,
    Guy M

  13. #13
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Guy

    That image is impressive !
    But, again, before we proceed to your logic flow, what is it a screen shot of?
    - a VB6 form you created with TextBoxes, OptionButtons, and Labels?
    - something else?


    Sorry to be hung up on this, but if you've already created this in VB6, that lets
    me know we can move directly to your logic flow.

    Spoo
    Last edited by Spoo; Apr 2nd, 2010 at 03:00 PM.

  14. #14

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    I dragged & dropped a bunch of optionbuttons, textbox's & labels around in VB6. Print screened it & then added the color & -/+ symbols.

  15. #15
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Dynamic table?

    If you are going to use VB6 with a bunch of controls, then creation of Control Arrays will be better.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  16. #16
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Guy

    Excellent.
    And akhil's suggestion about control arrays is a good idea.

    Now.. one last question before going on to the logic flow...

    What is the purpose of this?
    - is it a game? (hence, form's layout as shown is to be utilized)
    - is it a data entry form? (perhaps some other form layout would be appropriate)
    - something else?


    Spoo

  17. #17

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    Its for a game - F1 game. Its for Practice sessions where I get 8 runs to setup the car. I would input the cars setup (14 settings: front/rear downforce, front/rear height, caster, front/rear rollbar, front/rear tyre pressure, front/rear suspension, gears, brake size & brake balance). Each run I get suggestions (between 1 & 4) on a setting, lower or higher (pitcrew may also give me 1 suggestion on a slider). I need to keep track of how I change the setup, what sliders I had suggestions on.

    I will enter all the settings into the program, not attempt to extract it or anything complicated like that. The layout has no relation to the game, its just an idea to help me keep track of changes I make to the car.

  18. #18
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Guy

    OK, that helps a lot.
    Let me cogitate on that a bit. Other guys may step in in the interim.

    Just wanted to let you know I saw your post.

    Spoo

  19. #19

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    Take your time & thank you for helping.

    The problem I had is lack of knowledge. I didn't want to go ahead with my idea, make what you see above, but then later down the line realise I went the wrong way about it.

  20. #20
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Guy

    To recap -- correct me where I'm wrong

    - you're only dealing with 1 car
    - 14 rows pertain to different settings (front/rear downforce, etc)
    - first 8 cols pertain "trial run" set-ups (ie, unique)
    - 9th col pertains to final settings


    Code:
                                 Setups
    Settings                     1                    2               
                                 init  PC  delta      new   PC  delta
                                 ===============      ===============
     1  downforce - front        .     .   .          .     .   .
     2  downforce - rear         .     .   .          .     .   .
     3  height - front           .     .   .          .     .   .
     4  height - rear            .     .   .          .     -   .          .
     5  caster                   .     .   .          .     .   .
     6  rollbar - front          .     +   .          .     .   .
     7  rollbar - rear           .     .   .          .     .   .
     8  tyre pressure - front    .     .   .          .     +   .          .
     9  tyre pressure - rear     .     .   .          .     .   .
    10  suspension - front       .     .   .          .     .   .
    11  suspension - rear        .     .   .          .     .   .
    12  gears                    .     -   .          .     .   .
    13  brake size               .     .   .          .     +   .          .
    14  brake balance            .     -   .          .     .   .
    Let's see how well I get it... again, correct me where I'm wrong

    Setup-1. You enter the 14 "init" values for Setup-1 "on your own". The pitcrew (PC) gives you some suggestions
    Setup-2. You now enter values for Setup-2, based on these suggestions.
    There are 2 way we could go here:
    -- you enter a new value, or...
    -- you enter a delta (the change), and your app calculates the new value (as is shown in diagram above)

    Setup-3. Repeat the process.

    Questions:
    1. Where does the Bonus come into play?
    2. What have I left out?


    And, thinking ahead as to how to show this on your screen, several options.

    1. Use a MSHFlexGrid, freeze col 0, and rows 0,1,2, and use horiz slider. This
    way, it doesn't take a hugely wide screen to display; rather, you'd see 2 or
    3 adjacent setups at a time. But, at least all of your progressive changes
    would be preserved for you to review.

    2. Use TextBoxes for entry, but as control array. To achieve a similar
    "horizontal slider" feature, you'd place them on a PictureBox-in-a-PictureBox
    (I can more fully describe later if you like) so you can use a slider and view

    Spoo
    Last edited by Spoo; Apr 4th, 2010 at 08:45 AM.

  21. #21

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    First I would like to say a big thank you for taking the time to help me, so Thank you very much

    - you're only dealing with 1 car - Yes
    - 14 rows pertain to different settings (front/rear downforce, etc) - Yes
    - first 8 cols pertain "trial run" set-ups (ie, unique) - Yes
    - 9th col pertains to final settings - No, the 9th Column is the pitcrew suggestions. The other suggestions are from the driver. The 8th column is the final setup.

    "The pitcrew (PC) gives you some suggestions" - Sorry I didn't make it clear previously, but the 9th column is entry for the pitcrew suggestions (max of 1 pitcrew suggestion per run (8 runs in total), some times there are none). The other suggestions come directly from the driver (max of 4 suggestions per run).

    If I get suggestions on a setting from the driver, lets say 'Gears' 200 & the suggestion is 0-200, I would then enter anything from 0 upto 199 for Gears on the second setup myself. The same apply for any other suggestions.

    The bonus gives a bigger improvement in time (that setting effects the car more on that particular tracks). When/if I locate what setting that is I need to remember what setting it is.

    I'm open to any suggestion, what you think is ideally suited for this project. FlexGrid seems the right way, but I don't know much about it. TextBoxes look easiest from my perspective, once I can get one row working I can simply duplicate it for the others, Whereas FlexGrid seems more complicated in that respect.

  22. #22
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Dynamic table?

    Guy

    Thanks.. you're wlecome.
    OK, given your update, a revised logic diagram:


    Code:
                                 Setups
    Settings                     1                2                3
                                 init  D  P  B    new   D  P  B    new
                                 =============    =============    ====
     1  downforce - front        o     .  .  .    o     .  .  .    o
     2  downforce - rear         o     .  .  .    o     .  .  .    o
     3  height - front           o     .  .  .    o     .  .  .    o
     4  height - rear            o     .  .  .    o     -  .  .    o
     5  caster                   o     .  .  .    o     .  .  .    o
     6  rollbar - front          o     +  .  .    o     .  .  .    o
     7  rollbar - rear           o     .  .  .    o     .  .  .    o
     8  tyre pressure - front    o     .  .  .    o     +  .  .    o
     9  tyre pressure - rear     o     .  .  .    o     .  .  .    o
    10  suspension - front       o     .  .  .    o     .  .  .    o
    11  suspension - rear        o     .  .  .    o     .  .  .    o
    12  gears                    o     -  .  .    o     .  .  .    o
    13  brake size               o     .  .  .    o     +  .  .    o
    14  brake balance            o     -  .  .    o     .  .  .    o
    
    
    
    Legend:
    
     o = entry you make        D = driver
     . = feedback              P = pitcrew
                               B = bonus
    Logic sequence:

    1. You enter "init" settings in Setup-1 col
    You then receive feedback from D P B
    - D max of 4 suggestions
    - P max of 1 suggestion
    - B max of 1 -- if flagged as B, then this row stays fixed from here on


    2. You enter new settings in Setup-2 col.
    You then receive feedback from D P B
    - D max of 4 suggestions
    - P max of 1 suggestion
    - B max of 1 -- if previously flagged as B, no changes this row; else, as above


    3-8. repeat -- up to and including Setup-8, which is final.

    Closer?
    If so, what do you need next?

    EDIT: re: your thoughts on FlexGrid vs TextBoxes.. good ones.
    Let's table that for the moment.

    Spoo
    Last edited by Spoo; Apr 4th, 2010 at 01:38 PM.

  23. #23

    Thread Starter
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: Dynamic table?

    Everything is perfect, apart from 'Bonus' (B). The bonus isn't any different to a suggestion, it just highlights that setting in amber instead of green (green is a normal suggestion). D max of 4 suggestions (1 suggestion could be the bonus, the bonus setting is the same for all 8 runs, but the setting (number) itself could change) - P max of 1 suggestion.

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