Results 1 to 4 of 4

Thread: How to trigger a popup form in Access table View

  1. #1
    VBAX Newbie
    Joined
    Apr 2010
    Posts
    1
    Location

    How to trigger a popup form in Access table View

    Hello guys, I'm new to VBA. I was wondering if it is possible to invoke a popup form inside a table in View mode and make it appear on x,y coordinate. Thanks in advanced.

    Regards,

    Alexis D.

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,297
    Location
    Tables do not have "Event Procedures" to trigger the VBA code.
    Why would you want to look at tables in View mode, forms are for viewing the data?

  3. #3
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,675
    Location
    You might be able to do something like this on a form that's using Data Sheet View... google's not providing any good info on this subject yet- it'll take some searching to find.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  4. #4
    Design your form to display in datasheet mode and then put the following in a public standard module. Set your forms OnMouseMove event to the following "=mousepos()". This will display your popup form. You will need to determine the X and Y coordinates of whatever box you want to define to trigger the popup.

    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
     
    Private Type POINTAPI
            x As Long
            y As Long
    End Type
     
    Dim a As POINTAPI
    Dim blnPopup As Boolean
     
    Public Function mousepos()
    
    Dim var As Variant
    Dim ret As Long
     
    ret = GetCursorPos(a)
    ' Define a rectangular area and display a popup if mouse is within this box
    
     If a.x > 400 And a.x < 600 Then
        If a.y > 200 And a.y < 300 Then ' mouse is within confines of box - display popup
           If Not blnPopup Then
             DoCmd.openForm "frmPopup"
             'Set a boolean to indicate popup is displayed to prevent action when moving the mouse again until popup is closed
             blnPopup = True
           End If
        End If
     End If
     
    End Function
     
    Public Function closePopup()
    
    ' run this function in the onClose Event of your popup form to reset the boolean flag
    blnPopup = False
    End Function
    Neatness counts, spelling matters and formatting is REQUIRED. RTFM - I did. STFW - I do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •