Treeview Right Click Context Menus in Access

P

peterzeke

Hello:

I'm trying to implement a solution (work around) for displaying a context
menu when right-clicking on a treeview in MS Access 2003.

I came across a fine article that actually detects the mouse location of the
click, and then displays a regular Access form (that is designed to look like
a popup menu) at the location of the mouse.

Here's a link to the article:
http://www.developersdex.com/gurus/articles/386.asp

Unfortunately, MS Access keeps giving me an error "user-defined type not
defined" when it comes across the following declaration:

Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long,
lpRect As RECT) As Long

Any assistance in getting the above code to work or a better solution to
creating a custom context-menu would be appreciated.

Thanks,
Pete
 
R

Ralph

Try adding the following to your module. Not sure Access knows what Rect is ;)

Public Type Rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top