Results 1 to 8 of 8
  1. #1
    Jed63's Avatar
    Jed63 is offline Novice
    Windows XP Access 2000
    Join Date
    Mar 2015
    Posts
    4

    Command button to add set number to a field

    I’m a member of a martial arts club.

    We have an old laptop running XP.


    I have an old Access 2000 disc which I no longer use, and this has been loaded to that machine.

    I am trying to build a very simple database to keep track of the members’ hours and I’m stuck.
    The table name is “Main_Table”, the fields are; [ID],[Name].[Hours]
    A form exists “Sign In”.
    On the Form, “Sign In” I need a Combo Box or List Box to select a record (name) then a command button which adds 2 hours to the number of hours already in the [Hours] field of that selected record, simple as that….I can’t get anything to run.

    I’m out of touch with Access by umpteen years and I think I’ve forgotten a lot of it.

    Thanks
    Jed

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I would re-examine the design. If you just update the hours, you have no history. I would store each visit in a related table, with fields for member ID, date hours and anything else relevant. You can then sum up the hours for each member from that raw data.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Jed63's Avatar
    Jed63 is offline Novice
    Windows XP Access 2000
    Join Date
    Mar 2015
    Posts
    4
    Thanks for the reply.
    "If you just update the hours, you have no history."
    I understand what you're saying, but the history is not relevant, as the quantity of hours will be zeroed every time the student attains the next grade. The dates of the training hours are also irrelevant. It doesn't need to be that complicated.
    So all I need is a way to add 2 hours to the selected record at the click of a button, would this need code?

    Thanks
    Jed

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Your call. Sooner or later somebody's going to say their hours aren't right and you'll have no way to track. Presuming the form is bound to the table and on the correct record:

    Me.TextboxName = Me.TextboxName + 2
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Jed63's Avatar
    Jed63 is offline Novice
    Windows XP Access 2000
    Join Date
    Mar 2015
    Posts
    4
    I'm not going to argue with 5th, 4th, and 2nd Dan black belts at my grading that my hours aren’t right, you still have to pass the grade . It's just a rough guide for the sensei so that he can get an idea of a students progress.
    Me, that's what I forgot, in the 'On Click' property, yes?

    Jed

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Come on, you gotta stand up to these people!

    What I posted is VBA, it would go here:

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Jed63's Avatar
    Jed63 is offline Novice
    Windows XP Access 2000
    Join Date
    Mar 2015
    Posts
    4
    Standing up is not that easy with those three around.
    Yep, that's where I thought it would go.
    You have a very usefull website.
    And thank you for all your help, greatly appreciated.

    Jed

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-07-2013, 11:07 AM
  2. Replies: 3
    Last Post: 10-17-2011, 01:13 PM
  3. Command button to change value of other field
    By teirrah1995 in forum Programming
    Replies: 8
    Last Post: 09-09-2010, 10:23 AM
  4. Changing Field Values with Command Button
    By avarusbrightfyre in forum Access
    Replies: 1
    Last Post: 08-22-2010, 12:48 PM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums