Can't SetFocus on Field?!!!

DaniBoy

Registered User.
Local time
Today, 10:52
Joined
Nov 18, 2001
Messages
174
Hello,

I dont know why this is happening, I have a subform that has 4 fields, I want to set the focus on field three, this is what I do:


On field 1 I enter a value, on field 2 I enetr another value, on field three I want to skip, and field for I enter another value.

On the event On LostFocus on the Feild 2 I put Field4.SetFocus

Well two thing happen, at first I dont get the dropdown box after the feild4."Right here" that lets you pick from a list."Detected the problem there" Second i go ahead and type in SetFocus and save it. Then when I run it, I get an error "Object Required" I checked the name of the feild4 and everything look right. My fields are bound an everything.

Whats wrong? Why it does not detect the field.?
 
I believe you need to use the FULL name for the field AND refer to the name of the Subform Control (not the subform name).
For example if your subform is named sfrmMySubform and the control on your main form that contains sfrmMySubform is named Child32 then you would do this:

Forms!frmMain.Form!Child32!Field4.SetFocus

Give that a try.
 
First, lets clarify what you wish to do.

From your description, it appears that you are navigating INSIDE your subform already when you wish to skip field3.

ie: After entering field2 value, you wish to move straight to field4 (?)

If you wish just to skip field3, you could set it's "Tab Stop" property to NO

If you wish to prevent the user from clicking on (or tabbing to) field3, set it's "Enabled" property to NO

If you wish to do none of these things, then you may have to re-describe your problem as I can not understand your last paragraph. ("right here" etc)??

Brad.
 

Users who are viewing this thread

Back
Top Bottom