Results 1 to 3 of 3
  1. #1
    lmcm1977 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2018
    Posts
    9

    Designing a macro to open a form based on the results of a parameter query

    Hi



    Is it possible to design a macro that will run a parameter query - display the results - and then open a form based on the results of the parameter query?

    I want to be able to search if a person is already entered on my database - if they are present show the record and then open "form A"

    If they arent present i want to show that the record doesnt exist - and then open "form b"

    Is this possible???? I am new to programming and macros so any help would be greatly appreciated!!!!!!!!!!!

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    in a continuous form that shows all records, put a text box to do the search,
    then when user pressed ENTER, it filters the results.

    set the afterupdate event:
    Code:
    sub txtFind_Afterupdate()
    If IsNull(txtFind) Then
       Me.FilterOn = False
    Else
       Me.Filter = "[PersonName] like '*" & me.txtFind & "*'"
       Me.FilterOn = True
    End If
    end sub

  3. #3
    lmcm1977 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2018
    Posts
    9
    thanks for the reply this worked perfectly!!!!!

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

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2017, 01:10 PM
  2. Replies: 5
    Last Post: 08-31-2015, 01:03 PM
  3. Macro to open report based on value in a form
    By iProRyan in forum Macros
    Replies: 2
    Last Post: 02-24-2014, 03:02 AM
  4. Replies: 2
    Last Post: 08-07-2013, 07:44 AM
  5. Open form based on query results
    By RobbertH in forum Queries
    Replies: 1
    Last Post: 02-10-2010, 08:13 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