Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    6

    Question Unanswered: How do I write a macro that opens up the single form data upon AfterUpdate?

    Hi,
    How do I write a macro that opens up the single form data upon AfterUpdate?

    For example:
    My first entry field is called ID# on the form. So, supposedly I am entering
    a new data entry, as soon as I entered the information for ID# (which is
    AfterUpdate), I would like to open up the file that will having matching ID#.
    So, how do I write a macro that will open up a form that already contains the
    ID#? If it does not that ID# already in the database, then I don't want that
    macro to run.

    Please help, thank you very much in advance.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Don't use macros!

    VBA is far more powerful and can do almost anything after updating any field or after saving a record. VBA can also interrogate the file system to find the file and if not found, do nothing else open the file.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Dec 2008
    Posts
    6
    I just realized what you meant in the other post that I made Yeah, search form is working great. I used a search form that goes through the query and look up for that entry and opens up in a database view window. Though I still need some enhancement.. I have a quick question if you do not mind me asking. My search form opens up a query with the database information in Database View. Is it possible that... once the search is performed, instead of open up the entry information in Database View, can it be opened up in a Form view? Thanks.

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yes, it can!

    The search form can simply restrict it's own data to only those records which match your criteria.

    For example, in a customer form you could have an unbound combo box for you to select the customer surname. After Updating that combo box you could:

    Me.Filter = "Surname = """ & me.UnboundComboBoxName & """"
    Me.FilterOn = True


    This would limit the displayed records by way of a filter.

    You could also do the same thing more efficiently by modifying the form's Record Source to include the specified criteria.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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