Solved

Simulate double click event in access vba

Posted on 2013-01-17
30
2,249 Views
Last Modified: 2013-01-17
Is it possible to simulate a double click event in access vba?
0
Comment
Question by:SweetingA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 17
  • 7
  • 3
  • +2
30 Comments
 
LVL 2

Expert Comment

by:MMTadmin
ID: 38789714
cmdButton_DblClick

Private Sub cmdButton_DblClik

'Do something

End Sub
0
 

Author Comment

by:SweetingA
ID: 38789736
Sorry probably not well explained

I want to switch the focus on a form to a graph and double click the graph, not use a double click event


Thanks
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 38789739
Me.SomeOtherControl.SetFocus

... then as MMTadmin stated ...

Call SomeOtherControl_DoubleClick
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 26

Expert Comment

by:jerryb30
ID: 38789740
With what other event?
0
 

Author Comment

by:SweetingA
ID: 38789746
You'll have to excuse my lack of knowledge but if i try something like this i get a error, object does not support this property or method

Me.Graph1.SetFocus
Call Graph1.DoubleClick

Thanks
0
 

Author Comment

by:SweetingA
ID: 38789747
sorry i used _Doubleclick its just a typo
0
 

Author Comment

by:SweetingA
ID: 38789752
now i get sub for function not defined
0
 

Author Comment

by:SweetingA
ID: 38789763
Am i missing a module to use the call DoubleClick?
0
 

Author Comment

by:SweetingA
ID: 38789824
Anyone know?

What is the code that actually makes the doubleclick event work?
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38789834
What are you trying to do? Enlarge the graph?
0
 

Author Comment

by:SweetingA
ID: 38789844
The graph displays on an after update event of a text box but only with a blank which box.

The graph detail never shows until i double click it.

So i want to double click it in vba and then move the focus back onto somthing else in the form so that i do not see the graph input table which also is displayed when i double click it.

Thanks
0
 

Author Comment

by:SweetingA
ID: 38789857
attached is a screen shot
screenshot.ppt
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38789869
in the design view of the form, select the graph and look at the Event properties tab the
On Dbl Click event

do you see it?
0
 
LVL 2

Expert Comment

by:MMTadmin
ID: 38789888
look in the help for the graph and see what a dblClick actually does and then just code it
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38789901
if there is a On Dbl Click event, you simulate it in vba with

public sub graph.dblclick(cancel as integer)

end sub
0
 

Author Comment

by:SweetingA
ID: 38789904
Hello Capricorn 1,

Yes i see it and i can understand that i can do things after double clicking it by using this but how do i double click it in the first place in vba?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38789941
make the event public, so you can call it from other place

see my post at http:#a38789901
0
 

Author Comment

by:SweetingA
ID: 38789968
Sorry i clearly too thick to follow the excellent advice, can you be more explicit for an idiot like me.

Public Sub Graph1_DblClick(Cancel As Integer)
End Sub

Private Sub Measure_AfterUpdate()
   Me.Graph1.Visible = True
   Me.Graph1.SetFocus
   Me.Graph1_DblClick
End Sub


Just results in "object not optional"

Thanks for your patience
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38789971
can you upload a copy of the db
0
 

Author Comment

by:SweetingA
ID: 38789983
yes of course, give me a minute or two
0
 

Author Comment

by:SweetingA
ID: 38789995
Its in frm_PDM_Results

Runs in the after update event of Measure

You might have to populate all 4 combo boxes to get it to trigger, please select...

2012, 01, WorkingCapital, NetBindingDays then i can be sure we are looking at the same thing.

By the way if you fix it you can help me solve why i cant move the focus back off it straight after (see code commented out)

Thanks for the help
TargetTracking.mdb
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38790014
use this


Me.Graph1_DblClick (0)
0
 

Author Comment

by:SweetingA
ID: 38790029
got rid of the error but never displayed the graph until i double clicked it manually
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38790032
it is working here..
TargetTrackingREV.mdb
0
 

Author Comment

by:SweetingA
ID: 38790036
not on my pc its not, still shows a white square until i double click it manually
0
 
LVL 2

Expert Comment

by:MMTadmin
ID: 38790040
You are just entering the Graph1_DblClick event

What the control actually does when you double click is still a mystery

If there is nothing already coded in the event then you need to look at the control and see what is actually happening when you dblClick it
0
 

Author Comment

by:SweetingA
ID: 38790050
how do i do that?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38790072
the graph that you have, have a value of double click in the Auto Activate property

it is on the Other Tab

set the Property to  GetFocus

you can then delete the Me.Graph1_DblClick (0)
0
 

Author Comment

by:SweetingA
ID: 38790096
that did it, thanks a lot
0
 

Author Closing Comment

by:SweetingA
ID: 38790102
perfect and simple in the end
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access question 3 42
Query one and two years from today's date 10 39
MS Access, hourly employee status 8 42
ASP Classic Query that needs to display more information 18 33
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question