Results 1 to 5 of 5

Thread: Design Question - MultiDimensional Array

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    TX
    Posts
    29

    Design Question - MultiDimensional Array

    Hey all.

    I would like some advice on designing an upgrade to my current program.

    I developed a program for daily scheduling of our workforce. Essentially, the user picks a day and shift. The program goes to the database, picks out all the applicable personnel assigned to that shift, and lists them on the form. The user (supervisor) then assigns them to the area they are going to work that day. I assigned an array, let's call it Worker(1 to 14), that holds their position while the program manipulates the entries and prints out the result.

    Now, I want to upgrade it so it lists the whole month. So, I have my basic program multiplied by up to 31 days.

    I would need to specify which day I'm talking about, as well as the individual worker.

    Would dimensioning an array, say Worker(1 to 31, 1 to 14) be the best way to handle this? That way, when the user picked a day, the program would place that value in the first dimension, and the program could operate as usual using the second dimension.

    If anyone has any other ideas, I would appreciate it.

    Thanks for all the help in the past on this project.
    Trick

  2. #2
    spetnik
    Guest
    that should work

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    TX
    Posts
    29
    Thanks for the prompt reply. However, I ran into a snag already...sigh.

    In my current form, I have the worker's names listed in a column of labels down the form. Next to the names are a textbox for input of the assigned area, txtWorker(1 to 14), also down the form.

    With the upgrade, I would need (up to) 31 columns of the 14 textboxes.

    So I need to be able to select, say the 25th column (day 25), and then work with the associated 14 textboxes in that column.

    My problem, then, is how to specify that 25th column, and access only those textboxes.

    As I understand it, the textbox can't be named txtWorker(25, 7), for example.

    Nor can I name it txtWorkerDay25(7), as I can't address the different names of the textboxes unless I do some type of CASE code based on the user's selection of the day.

    I hope I'm making sense here.

    Thanks again for the help.
    Trick

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    TX
    Posts
    29
    Just this one-time bump-a-rooski to see if anyone else has some design ideas.

    I just can't figure out how to name the darn textboxes so I can access the appropriate ones based on the day the user selects.

    Thanks for all the help folks.
    Trick

  5. #5
    Hyperactive Member Paul Warren's Avatar
    Join Date
    Jun 2000
    Location
    UK
    Posts
    282
    I'd use a grid control to behonest Trick. With that number of boxes things are starting to get a bit complicated. Also, with 31 * 14 textboxes resources are going be eaten up rapidly. If you had a grid then simply use rows for employees and columns for days of the month.

    Disable all the columns first. When the user clicks on a column heading to select a day then enable the column and those rows ( workers ) which are available. Something like the Flexgrid should be your best bet.

    This is just off the top of my head so might not be exactly right. I think a redesign is definitely necessary however, now the requirements have become more complex.
    That's Mr Mullet to you, you mulletless wonder.

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