Results 1 to 2 of 2
  1. #1
    ANTHROPOIDLUVA is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2012
    Posts
    13

    How to Use Search Form Query Result & GoTo Desired Record on Separate Form

    I ask help in writing code in VBA that allow the following action to be achieved:



    Problem: I have two forms [Directory] and [Monkey Bar Search Tool] that I am trying to get them to talk to one another based upon a query result produced by [MBST]. The [D] form does not have conventional fields. Instead, it has concatenated textbox expressions (i.e., = [FIRSTNAME] & " " & [LASTNAME]; ="Staffed as" & " " & [PositionTitle]). A command button on [D] form opens up [MBST] form and allows the user to enter search criteria including First name, Last name, Department number, and Position title. This form is driven by a query [MBSTquery]. Once the Run Query command button is clicked, the query results of the record or associated records based on user input is displayed in datasheet view. I would like query result to automatically go to record (or records) on [D] form, which remains open while user dialogs with the [MBST] form. I am aware of the combo box, but would like to go a different route instead to perform search...just not sure how to connect the dots between the two forms.


    I have the following code in place for the [MBST] form:

    Private Sub Command67_Click()
    DoCmd.OpenQuery "MBSTquery", acViewNormal
    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why open the query?

    Options:

    1. use query parameters in the RecordSource for form [Directory]

    2. code sets Filter and FilterOn properties of form [Directory]
    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: 8
    Last Post: 03-18-2012, 11:17 AM
  2. Replies: 13
    Last Post: 01-29-2012, 01:45 PM
  3. adding record by using separate form
    By jacek.w.bak in forum Forms
    Replies: 1
    Last Post: 09-11-2011, 06:15 PM
  4. Replies: 1
    Last Post: 06-01-2011, 06:44 PM
  5. Replies: 1
    Last Post: 12-22-2010, 01:28 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