About
Pricing
Community
Teams
Start Free Trial
Log in
Larry Brister
asked on
12/21/2012
MS Access Listbox Context Menu
On my listbox I would like to add a function to the Right Mouse Click.
Essentially I was it to say..."Remove Client from Visit"
On click run a Sub.
Microsoft Access
Microsoft Development
Microsoft Applications
7
2
Last Comment
Larry Brister
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dale Fye
12/21/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
12/21/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jeffrey Coachman
12/21/2012
Not sure about right-clicks in Access 2007/2010.
Why not just put this on a button?
So the user could just select the Record from the listbox, then click the button to "remove"...
The code would be something like this regardless:
Dim strSQL as string
strSQL ="DELETE * FROM YourTable WHERE ClientID=" & lstClient
Currentdb.execute strSQL, dbfailonerror
me.lstClient.requery
JeffCoachman
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
12/21/2012
"Not sure about right-clicks in Access 2007/2010."
?
Dale Fye
12/21/2012
Right clicks (shortcut menus) are not a problem in 2007, but have not tested with a 2010 listbox.
Your help has saved me hundreds of hours of internet surfing.
fblack61
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
12/21/2012
All MenuBars (Menus, Toolbars & Right Click) port over to A2010 from A2003.
mx
Larry Brister
12/24/2012
ASKER
Sorry for late get back.
Tested both answers.
Thanks
Why not just put this on a button?
So the user could just select the Record from the listbox, then click the button to "remove"...
The code would be something like this regardless:
Dim strSQL as string
strSQL ="DELETE * FROM YourTable WHERE ClientID=" & lstClient
Currentdb.execute strSQL, dbfailonerror
me.lstClient.requery
JeffCoachman