Link to home
Start Free TrialLog in
Avatar of Tom Crowfoot
Tom CrowfootFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Automated Pop up Form

Dear Experts

Im using Access 2003 & have a form which has a list of people (frm_Quick-Search), next to each record is a command button (QuickViewCMD) which fires up a pop up form ("frm_quick_view") so the user can see notes on the person.  This all works fine but I have to close the pop up form each time that I want to look at the next person.  What I want to be able to do is either

When the persons mouse hovers over the Command Button the form opens up and closes when the mouse moves away.

Or

Some how close the last instance of the form and reopen it to show the relevant record (this might be impossible as the pop has to be opened first & needs a link to show the correct records in the first instance)

Or

Use the logic of ... if frm_quick_view is closed then open where ([people_id]=" & Me![people_id]) If its open change the link ([people_id]=" & Me![people_id])

Private Sub QuickViewCMD_Click()
On Error GoTo Err_Command59_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frm_quick_view"
    stLinkCriteria = "[people_id]=" & Me![people_id]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command59_Click:
    Exit Sub

Err_Command59_Click:
    MsgBox Err.description
    Resume Exit_Command59_Click
    End Sub

Can anybody help???
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try using the OnCurrent event of the form and close the frm_quick_view when the record changes.

Private Sub Form_Current()
   On error resume next
   DoCmd.Close acForm, "frm_quick_view "
 End Sub
Avatar of Tom Crowfoot

ASKER

That's Brilliant, thank you