Results 1 to 3 of 3

Record Count in a Macro

  1. #1
    Join Date
    May 2019
    Posts
    44

    Record Count in a Macro

    Hi,


    I have a search form which leads to a search query and then to a multi-record form displaying the matches (result of the query). After the selecting a specific record, it then opens a a single record form. What I want to do is go directly from the query to the single record form if it only finds one matching record. I don't want to use VBA. Any suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,335
    Code behind search form would have to determine if there will be more than 1 record then open appropriate form.
    I don't use macros but
    I think macros can use domain aggregate functions.
    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.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    6,410
    I don't know what 'leads to a query' means, but if the query only returned 1 record based on search criteria, where the count of some field is 1, then just open a form to that query result? If the count doesn't = 1 there'd be no query result. I don't use macros either, so am not sure how difficult it is to ascertain things like whether or not a query returns records thus should or should not open a form but rather show a message.
    - "doesn't work" is no help. Post err msgs and where.
    - Use code tags for code/sql. Implement changes in copies of your database.

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

Similar Threads

  1. Count Record
    By JakeL in forum Access
    Replies: 4
    Last Post: 05-03-2019, 08:09 AM
  2. Replies: 4
    Last Post: 01-15-2019, 11:50 AM
  3. Replies: 5
    Last Post: 02-24-2017, 08:09 AM
  4. Updating Multiple Record Form Based on Record Count
    By William McKinley in forum Forms
    Replies: 2
    Last Post: 12-31-2014, 12:45 PM
  5. Replies: 30
    Last Post: 08-15-2012, 02:25 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
  •  
Tech Forums: Microsoft Office Forums