Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2582
  • Last Modified:

Simulate double click event in access vba

Is it possible to simulate a double click event in access vba?
0
SweetingA
Asked:
SweetingA
  • 17
  • 7
  • 3
  • +2
1 Solution
 
MMTadminCommented:
cmdButton_DblClick

Private Sub cmdButton_DblClik

'Do something

End Sub
0
 
SweetingAAuthor Commented:
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
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Me.SomeOtherControl.SetFocus

... then as MMTadmin stated ...

Call SomeOtherControl_DoubleClick
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
jerryb30Commented:
With what other event?
0
 
SweetingAAuthor Commented:
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
 
SweetingAAuthor Commented:
sorry i used _Doubleclick its just a typo
0
 
SweetingAAuthor Commented:
now i get sub for function not defined
0
 
SweetingAAuthor Commented:
Am i missing a module to use the call DoubleClick?
0
 
SweetingAAuthor Commented:
Anyone know?

What is the code that actually makes the doubleclick event work?
0
 
jerryb30Commented:
What are you trying to do? Enlarge the graph?
0
 
SweetingAAuthor Commented:
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
 
SweetingAAuthor Commented:
attached is a screen shot
screenshot.ppt
0
 
Rey Obrero (Capricorn1)Commented:
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
 
MMTadminCommented:
look in the help for the graph and see what a dblClick actually does and then just code it
0
 
Rey Obrero (Capricorn1)Commented:
if there is a On Dbl Click event, you simulate it in vba with

public sub graph.dblclick(cancel as integer)

end sub
0
 
SweetingAAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
make the event public, so you can call it from other place

see my post at http:#a38789901
0
 
SweetingAAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
can you upload a copy of the db
0
 
SweetingAAuthor Commented:
yes of course, give me a minute or two
0
 
SweetingAAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
use this


Me.Graph1_DblClick (0)
0
 
SweetingAAuthor Commented:
got rid of the error but never displayed the graph until i double clicked it manually
0
 
Rey Obrero (Capricorn1)Commented:
it is working here..
TargetTrackingREV.mdb
0
 
SweetingAAuthor Commented:
not on my pc its not, still shows a white square until i double click it manually
0
 
MMTadminCommented:
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
 
SweetingAAuthor Commented:
how do i do that?
0
 
Rey Obrero (Capricorn1)Commented:
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
 
SweetingAAuthor Commented:
that did it, thanks a lot
0
 
SweetingAAuthor Commented:
perfect and simple in the end
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 17
  • 7
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now