Moving focus from sub form to main form

  • Thread starter Thread starter Robin Chapple
  • Start date Start date
R

Robin Chapple

I have a main form where the sub form is tab 20.

I need to tab from the last tab on a sub form back to the next tab on
the main form.

My main form is "frmMembers" and the target field is [Notes].

I have used the "Lost Focus" property on the last field on the sub
form with this code:

Forms![frmMembers].[Notes].setfocus

""Can't find macro "Forms!frommembers"

I read the page on forms from the Access Web site

where the advice was:

Me.Parent!ControlName

which I have implemented as:

Me.Parent![Notes].setfocus

and that also gives the error message that it can't find the macro.

What am I missing?

Thanks,

Robin Chapple
 
Robin Chapple wrote in message
I have a main form where the sub form is tab 20.

I need to tab from the last tab on a sub form back to the next tab on
the main form.

My main form is "frmMembers" and the target field is [Notes].

I have used the "Lost Focus" property on the last field on the sub
form with this code:

Forms![frmMembers].[Notes].setfocus

""Can't find macro "Forms!frommembers"

I read the page on forms from the Access Web site

where the advice was:

Me.Parent!ControlName

which I have implemented as:

Me.Parent![Notes].setfocus

and that also gives the error message that it can't find the macro.

What am I missing?

Thanks,

Robin Chapple

Just a quick question, you are using the on lost focus
event _procedure_ - vs pasting the line into the on lost
focus property?

If so, use the button with three dots on the right to enter
VBE, and place the code there.
 
Roy,

Bingo, Thanks very much and I understand as well which is a win.

Cheers,

Robin Chapple

Just a quick question, you are using the on lost focus
event _procedure_ - vs pasting the line into the on lost
focus property?

If so, use the button with three dots on the right to enter
VBE, and place the code there.
Robin Chapple wrote in message
I have a main form where the sub form is tab 20.

I need to tab from the last tab on a sub form back to the next tab on
the main form.

My main form is "frmMembers" and the target field is [Notes].

I have used the "Lost Focus" property on the last field on the sub
form with this code:

Forms![frmMembers].[Notes].setfocus

""Can't find macro "Forms!frommembers"

I read the page on forms from the Access Web site

where the advice was:

Me.Parent!ControlName

which I have implemented as:

Me.Parent![Notes].setfocus

and that also gives the error message that it can't find the macro.

What am I missing?

Thanks,

Robin Chapple
 
Back
Top