Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    30

    Talking Unanswered: Tutoring In Access 2002

    Hi, All!

    My first post.

    I'm tutoring down at the local college in Advance Access. When I took this class, I had a different professor. We never develed into macros.

    My tutee's professor is teaching them macros using VBA. I have some entry-level Visual Basic 6 knowledgeexperience.

    Here is the assignment, which is due in one week:

    CPT 297-26 Homework #2
    Traffic Light

    Assignment:

    Create three forms: Red, Yellow and Green. Each form will contain a button. The button clicked event will kick off a macro showing the next color light. When a light changes, the previous light must be closed.

    The forms must be identical in all ways except color. The Red form will be the color Red, the Green form will be the color Green and the Yellow form will be the color Yellow. Since no data will be entered on these forms, any navigation, and data update functionalityh on the forms. The form should show nothng but a command button.

    All I'm asking is to be led in the right direction. Any and all help will be greatly appreciated.

    Thanks in advance,

    vbprogwb (B0b)

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    One of the tricks is to know the status of the light. You can do this with either a public variable or a table.

    I'm going to develop the solution using a table. Sounds like fun, and is probably more reliable.

    There's another major trick that I'm omitting because it's your homework, I'll let you know it this time tomorrow if you haven't seen it yet.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Sep 2003
    Posts
    30

    Tutoring in Advance Access

    HomerBoo,

    Thanks for responding.

    I've been working on it since posting my question.

    I took my cue from: "The button clicked event will kick off a macro showing the next color light. When a light changes, the previous light must be closed"

    I created the 3 forms with a command button on each. I got into the button(s) properties, Event - On Click. Created a macro using Action:Close Action:OpenForm - Form Name: frmRed; ActiontopMacro. I then converted the macros to Visual Basic.

    My tutee's assignment sheet says nothing about using a table, but I can't wait until I see your finished product. Would really appreciate it!!

    Thanks again for responding.

    Thanks in advance,

    vbprogwb (Bob)

    PS
    Check out the attachment.
    Attached Files Attached Files

  4. #4
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Hrumph! I didn't know that code would still execute once the form was closed. That, uh, was the trick to watch for. I was going to pass control to a status module, then open another form that had a Form_Open event. Must be new to Access 200X. That aside, I will post my db later (prob by tomorrow).

    Since you seem to be well on your way, you may want to consider removing the Navigation buttons, the record selector, and the dividing lines. The form will look cleaner.

    Also the line //The forms must be identical in all ways except color// seems to be loaded. I would copy the left, top, width, and height from one command button and apply it to the other two.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  5. #5
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Here are two solutions as requested. The table based one (tlight_table.mdb), IMHO, isn't as slick as the tLight.mdb solution.
    Attached Files Attached Files
    All code ADO/ADOX unless otherwise specified.
    Mike.

Posting Permissions

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