Simulate a mousebutton click on a textbox field

J

JC

Hi All,

I'd like to requery a subform from a button on the mainform, setfocus to
the name fieldon the subform and simulate a mousebutton click, which
executes a series of filters and other commands.

I can requery the subform :), I can set focus to the name field on the
subform :), but I just don't know how to simulate a mousebutton click on
the subform :(

Any ideas greatly appreciated,

Jeff C.
 
M

Marshall Barton

JC said:
I'd like to requery a subform from a button on the mainform, setfocus to
the name fieldon the subform and simulate a mousebutton click, which
executes a series of filters and other commands.

I can requery the subform :), I can set focus to the name field on the
subform :), but I just don't know how to simulate a mousebutton click on
the subform :(


Just call the button's click event procedure using syntax
like:

Me.subform.Form.button_Click
 
J

JC

Thanks Marshall

I tried your code but it didn't work
I also tried

Me.fmSubEscholha.Form.Requery
Me.fmSubEscholha.Form!Nome.SetFocus
Forms![frmAlunos]![fmSubEscholha].Form.cmdUpdate_Click

No luck.

Any other ideas very welcome,

Jeff C
 
J

JC

OOps...

Targeted the wrong object and I moved the button to another subform
becuase it's the only place the button needs to be fired from (the
subform changes depending on other criteria. ;(

Should have been:

Forms![frmAlunos]![fmSubEscholha].Form.Nome_Click

Anyway, it still won't fire the onClick event in the subform.

I also tried:

Forms![frmAlunos]![fmSubEscholha].Nome_Click
Me.Parent.[fmSubEscholha].Form.Nome_Click

No luck!

Thanks,

Jeff C
 
M

Marshall Barton

JC said:
Targeted the wrong object and I moved the button to another subform
becuase it's the only place the button needs to be fired from (the
subform changes depending on other criteria. ;(

Should have been:

Forms![frmAlunos]![fmSubEscholha].Form.Nome_Click

Anyway, it still won't fire the onClick event in the subform.

I also tried:
WRONG: Forms![frmAlunos]![fmSubEscholha].Nome_Click
Me.Parent.[fmSubEscholha].Form.Nome_Click


Make the click event procedure is Public.
 
J

JC

thanks Marshall,

I Followed your advice and made the function Public and called it.
It works great.
Appreciate the help,

Jeff C.

Marshall said:
JC said:
Targeted the wrong object and I moved the button to another subform
becuase it's the only place the button needs to be fired from (the
subform changes depending on other criteria. ;(

Should have been:

Forms![frmAlunos]![fmSubEscholha].Form.Nome_Click

Anyway, it still won't fire the onClick event in the subform.

I also tried:

WRONG: Forms![frmAlunos]![fmSubEscholha].Nome_Click
Me.Parent.[fmSubEscholha].Form.Nome_Click



Make the click event procedure is Public.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top