Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 4th, 2003, 09:19 PM
Authorized User
 
Join Date: Sep 2003
Location: , , Canada.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mouse Click Event

Is there a way to capture more details about the Mouse click event object? Specifically right click events, shift + click or control click, in an access Front end. It would be useful to have a context menu or have some different things happen during certain mouse clicks but I can't seem to find any documentation that will let me access anything during those events.

It would be in reference to the mouseClick event specifically and no the mouse over or mouse down or up because the values the controls you are hovering over will not update until the click event seems to have fired.

Thanks in advance for any advice.
Regards
-Roni

Roni Estein
Roni.Estein@e-drugscanada.com
https://www.e-drugsCanada.com
__________________
Roni Estein
Roni.Estein@e-drugscanada.com
https://www.e-drugsCanada.com
Reply With Quote
  #2 (permalink)  
Old December 8th, 2003, 07:00 PM
Authorized User
 
Join Date: Nov 2003
Location: Paola, Europe, Malta.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the only way I know and it works even if it is a mouseDown not a mouse click. The end result will be the same if you only want to display a popup menu. I used message boxes to display the information showing which buttons are being used in conjunction with the mouse.

Private Sub Form1_MouseDown(Button as Integer, Shift as Integer, _
      as Single, Y as Single)
   Dim strMsg as String
   Select Case Button
     Case 1: strMsg = "Left"
           Select Case Shift
                  Case 0: strMsg = strMsg & " + No Shift"
                  Case 1: strMsg = strMsg & " + Shift"
                  Case 3: strMsg = strMsg & " + Ctrl + Shift"
           End select
     Case 2: strMsg = "Right"
           Select Case Shift
                  Case 0: strMsg = strMsg & " + No Shift"
                  Case 1: strMsg = strMsg & " + Shift"
                  Case 3: strMsg = strMsg & " + Ctrl + Shift"
           End select
   End Select
   msgbox strMsg
End Sub

Good luck :)
Reply With Quote
  #3 (permalink)  
Old December 9th, 2003, 04:22 PM
Authorized User
 
Join Date: Sep 2003
Location: , , Canada.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks,

I've tried this method with limited success. My main stopping block the context. The value of the item I am clicking on is not the value of the current object set. To clear that up: Lets say mouse is over one data item in a list and right click over it.

ListBox

1 Albert
2 Bob
3 Carl
4 Doug

If I click on Bob, The mouseClicked event will register lbNam.value as 2, the mouseDown event will register lbNam.value as Null or -1.
If I then click on doug the mouseClicked event will register lbnam.value as 4, and the mouseDown event will now register as 2. The context is only calculated after the mouseDown Event.

Is there any way around this. Is there a way to force the calculation first or steal properties from the mouseClick event?

Thanks for your contribution, and any other advice will also be much appreciated.

-Roni

Roni Estein
Roni.Estein@e-drugscanada.com
https://www.e-drugsCanada.com
Reply With Quote
  #4 (permalink)  
Old December 10th, 2003, 03:21 PM
Authorized User
 
Join Date: Nov 2003
Location: Paola, Europe, Malta.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I cannot understand the end reult that you are expecting after you rightclick a row in a listbox. Maybe I can help you if you give me a simple idea of the result that you want. The mouse_click event is a predefined function that is built in ms access. You cannot change it, you can only add properties to objects like forms etc... You can also add methods by adding your own functions to a form_module. the mouse_click event belongs to the
current object.
Reply With Quote
  #5 (permalink)  
Old December 11th, 2003, 04:53 AM
Authorized User
 
Join Date: Sep 2003
Location: , , Canada.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I apologize for the confusion. The context menu in this case or even the alternate button click will work directly on a data item in a list box.

An example of that might be a single click will populate the current for with the data of the person click on. So for instance if I clicked on Joe Shmoe in the list box

The first name and last name fields would get the values Joe and Schmoe. As series of fields denoting personal information, comments and also a linked sub form would be populated with the respective information on Joe Schmoe.

This all works fine.
It would be nice if I could create a small context menu when right clicking on Joe Schmoe, to open a corresponding order. This is currently in the dbl click event. Other choices could open other reports on him or even other appropriate forms such as an invoice. All these things are currently done with other buttons and actions, yet the people using the software asked me to create this feature so all the possible functions to be run on this person would be found in a context menu by right clicking on the name of the person, in the list box.

The problem with using the mouse down event is that the value of the list box item that you are clicking on does not update until after the mouse up event. I know that the windows API has far more properties on the mouse click event itself. I was just wondering how you access these properties in Access, pardon the pun.

Best Regards
-Roni


Roni Estein
Roni.Estein@e-drugscanada.com
https://www.e-drugsCanada.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
determine mouse click position amr_qura Struts 0 June 26th, 2007 03:40 PM
Mouse right-click inoperable Neal Excel VBA 2 March 16th, 2007 05:32 AM
right click mouse event sen22 ASP.NET 2.0 Basics 5 December 16th, 2006 08:46 AM
Capturing Mouse Click Event whiterainbow ASP.NET 1.0 and 1.1 Professional 1 December 8th, 2005 01:44 AM
detect mouse click off form vb certified Beginning VB 6 6 July 7th, 2005 07:55 PM



All times are GMT -4. The time now is 04:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.