Results 1 to 4 of 4
  1. #1
    terry6582 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2017
    Location
    TN
    Posts
    21

    Macro assistance

    Need a macro that will open a form (Vendor form) if a check box (Vendor) is checked on the existing form (attend entry) from a button that closed the form (attendee entry) if the condition is not met, closing and saving the form (attendee entry) and returning to the switchboard entry form.



    If [vendor] is -1
    open form (Vendor)
    if [vendor] is 0
    save form
    close macro
    goto switchboard form

    Hope all that make sense.

    I am just getting into macro and need help.

    Terry
    baldcamper@yahoo.com

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    For some reason you supplied pretty vague form and control names, so something like this:

    Code:
    public sub CloseForm_Click()
       Select case Vendor
            case true
                docmd.openform "Vendor Form"
                docmd.close acform, me.name
            case false
                docmd.openform "switchboard entry form"
                docmd.close acform, me.name
        end select
    end sub

  3. #3
    terry6582 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2017
    Location
    TN
    Posts
    21
    Thanks for the prompt reply. Sorry the info was incomplete.

    Here is the scenario in a little more detail.

    Have a form (attendee entry form) which will be user will make data entry. The user may check a box for "vendor".

    When data entry if completed, the user will then click a button to close and save the form. Then be returned to the main menu.

    I "vendor" is checked on the "Attendee entry form, the user will be displayed a new form "Vendor Registration".

    I would like to call a macro from the "close and save button on the Attendee entry form". this macro automate the decision based on the condition of the check box "vendor".

    The database is well over 2G after compacting. Thus presents an issue with downloading.

    I have it in a DropBox folder that can be shared with you of I have a good email address. It will send you a message with a link.

    Terry
    baldcamper

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    OK, the code I supplied will work. Just substitute your valid form names.
    If you must have a macro, just follow these guidelines, using IF instead of Select Case:
    This is also VBA, but more easily translated to a macro.

    Code:
    public sub CloseForm_Click()
       If vendor = true then
                docmd.openform "Vendor Registration"
                docmd.close acform, me.name
       else     
                docmd.openform "Main form"
                docmd.close acform, me.name
       end if
    end sub

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

Similar Threads

  1. need some assistance
    By WillemTWC in forum Access
    Replies: 20
    Last Post: 03-14-2018, 12:10 AM
  2. Dlookup Assistance
    By Thompyt in forum Queries
    Replies: 4
    Last Post: 06-11-2017, 06:20 PM
  3. Assistance with query
    By LWOLF in forum Access
    Replies: 10
    Last Post: 05-24-2016, 05:12 PM
  4. VBA assistance
    By Kwbrown in forum Programming
    Replies: 3
    Last Post: 03-15-2014, 03:09 PM
  5. Qry Assistance Please
    By buck in forum Access
    Replies: 8
    Last Post: 12-31-2013, 08:52 AM

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