Results 1 to 2 of 2
  1. #1
    nchesebro's Avatar
    nchesebro is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2010
    Posts
    108

    Change Value using Button OnClick

    In creating a tour database, the reservation will undergo a total of 5 status codes, as follows:

    Someone calls or emails a reservation and the reservation is entered into the database

    1. Pending - The tour is marked pending untill all appointments and memos are sent by the receptionist
    2. Incoming - When the memos are sent and appoiontments made.
    3a. Arrival - The tour is marked arrival at 12:01 on the day of the tour.
    OR
    3b. Cancelled - If the incoming party calls and cancells their tour. If a tour is marked cancelled, it progresses no further down this list.
    4. Active - The tour is marked active when the scheduled day of the tour arrives (12:01 AM)
    5a. Completed - The tour is marked completed if the party appears and is taken for a tour.
    OR
    5b. No-Show - The Tour is a No-Show when a tour is scheduled, the day arrives, and the party does not appear and never called previously to cancel.

    There will be a reservation form, and when completed, a button is clicked and a macro is run to save and close the reservation form. When this button is clicked, I would like the txtStatus field in tblTour to be set to Pending.

    After that, the tour is set up via the scheduling form, and a button is clicked there when finished that saves and closes the form. I would like this button to change the txtStatus field in tblTour from Pending to Incoming.



    And so on and so forth...

    I am using the new macro builder in 2010... Can this be done as a macro or does this need to be done in vba codebehind?

    Can you show me how to do this in either the macro builder or vba code please? Thank you!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,970
    I don't use macros, only VBA. With the txtStatus field included in the form's RecordSource, try this in the button Click event VBA code:

    Me!txtStatus = "Incoming"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  2. Command button to change value of other field
    By teirrah1995 in forum Programming
    Replies: 8
    Last Post: 09-09-2010, 10:23 AM
  3. Set onclick via VBA
    By Gerry in forum Programming
    Replies: 6
    Last Post: 04-19-2010, 09:23 AM
  4. Replies: 3
    Last Post: 10-18-2009, 09:17 AM
  5. Replies: 2
    Last Post: 03-10-2009, 05:14 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