Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button to simulate a "On Dbl Click" event for a field/control

Status
Not open for further replies.

SallyG

Technical User
Sep 20, 2000
8
0
0
GB
Hi,

I need to have a button simulate a "On Dbl Click" event for a field/control in a subform when the button is clicked.

I know there is probibly a better way of doing this but i do have a good reason for wanting to use this method.

I have tried various ways of simulating the Dbl Click but with no luck so can anyone help ???

Just for information reasons, here's what Im using:

Mainform = FrmData
Subform = SumFrmData1
field/control = CtlDataID

Button = ButRun

Thank you in advance

Sally [sig][/sig]
 
Hi,
can you use the form double click event and make the button call that. If you want to let ppl double click anywhere on the line, then you have to call the form doubleclick for each control and the detail background.

Ive just reread your question and have decided i dont understand it. There is a double click for each control on the form anyway.

Perhaps you could reword the question it for me [sig][/sig]
 
Hi Sally,

Simple,!
I assume the button on the subform has some event/macro that it would normally call on it's double click event.

Me![YourSubFromName].Form.YourButtonName_DblClick

here

YourSubFromName is the name that the parent form (main form) knows the subform, check this in the main form's subform property tab under other->name

and

YourButtonName is the name of the button making
YourButtonName_DblClick the on double click event for the button.

HTH



[sig]<p>Robert Dwyer<br><a href=mailto:rdwyer@orion-online.com.au>rdwyer@orion-online.com.au</a><br>[/sig]
 
Hi Sally,

opps foregot you had the object names, and the requirement was to do the OnDoubleClick

private Sub ButRun_Click

Me![SumFrmData1].Form.CtlDataID_DblClick

end sub

now a gotcher here is that this will call the event on the row that has the focus in the subform! (even if you have focus on the main form) if this has a single record no problems, if it has many records displayed you will need to first setfocus on the record you want to preform the action on.

HTH [sig]<p>Robert Dwyer<br><a href=mailto:rdwyer@orion-online.com.au>rdwyer@orion-online.com.au</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top