Results 1 to 3 of 3
  1. #1
    bashtonmcse is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Connecticut
    Posts
    4

    Use a popup form to select a record in the primary form

    Over the years I have created a pretty good computer asset database in Access. In the primary device form I have buttons to display different types of devices using popup forms in datasheet view such as server, workstations, routers... I would like to add functionality to these popup forms that if I double click on a device in the popup form it will close the form and refresh the primary form with the record I double clicked on. I have started doing more programming of late in access and suspect I know parts of it, but also realize there may be multiple ways of doing it. Some suggestions on the best way would be helpful.



    Thanks

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    You could change the openargs that are called to the popupform to track what record will be updated in the popup. Read the openargs in the form loaded event, and store it in a private variable to the form. Use the double click event for the "device" in the popup form so that it uses the variable to know what record to update and then close the form.

  3. #3
    bashtonmcse is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Connecticut
    Posts
    4
    I don't think I explained it very well. The primary form displays device records with all the detail information. On this form we have several command buttons that open forms that display data in datasheet mode. We are not trying to pass parameters for a specific record to the called form. Each called form is filtered by a device type such as server, router, pc... What I am trying to do is that when one of the pop up forms are opened that the user can double click on a record in the form and have that form close and change the current record on the original form to the record selected in the popup form.

    I have gotten part of it to work, but the problem comes to the exiting of the form. When the popup form closes the focus is still on the original button. If I put the code to change the record in the click event it happens immediately upon clicking the button to open the form which is before a record is selected. If I put the code in the exit event then it will not happen until the focus on that button changes to another object.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-21-2015, 02:50 PM
  2. Replies: 1
    Last Post: 04-07-2014, 04:20 PM
  3. Replies: 5
    Last Post: 02-16-2014, 02:50 PM
  4. Replies: 1
    Last Post: 02-21-2013, 12:27 PM
  5. Combo boxes both primary keys to select record
    By Alexandre Cote in forum Forms
    Replies: 3
    Last Post: 08-10-2010, 07:11 AM

Tags for this Thread

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