Command button on Subform

T

T3

First a disclaimer. I am a rookie at code, so please be
gentle.

How can I create a command button to return the cursor to
a specific field on the main form?

Thanks!
 
D

Dirk Goldgar

T3 said:
First a disclaimer. I am a rookie at code, so please be
gentle.

How can I create a command button to return the cursor to
a specific field on the main form?

Thanks!

Suppose the control you want to go to on the main form is named
"txtFoo". Then your command button's Click event procedure should look
something like this:

Private Sub cmdYourButtonName_Click()

Me.Parent!txtFoo.SetFocus

End Sub

Substitute the name of your command button for "cmdYourButtonName", and
the name of the control on the parent form for "txtFoo".
 

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