More on tabbing to a field in a subform - Access 2000

A

Abay

The following works fine in reference to a field on the Master form

Forms!Fclient_and_sub!Cname.SetFocus

But when I reference a field on the sub form from the Master form the
following doesn't work.

Private Sub Info_Exit(Cancel As Integer)

Forms![FCldetail_subform]!Status.SetFocus

End Sub

I get the message that the subform does not exist.

Again any help would be much appreciated.

Abay
 
O

Ofer

The right syntax to refer to field in the subform will be
Forms![MainFormName]![SubFormName].Form![FieldName].SetFocus

And if you refer from the main form

Me.[SubFormName].Form![FieldName].setFocus
 
A

Abay

Thanks for your reply ... I have the following code in the "on exit" event
of my last field on the Master form:

Me.[FCldetail_subform].Form![Status].SetFocus

No error message, but the focus goes to the first field on the Master.

Just about ready to give up on this .. many thanks again for your help.

Abay

Ofer said:
The right syntax to refer to field in the subform will be
Forms![MainFormName]![SubFormName].Form![FieldName].SetFocus

And if you refer from the main form

Me.[SubFormName].Form![FieldName].setFocus


--
In God We Trust - Everything Else We Test


Abay said:
The following works fine in reference to a field on the Master form

Forms!Fclient_and_sub!Cname.SetFocus

But when I reference a field on the sub form from the Master form the
following doesn't work.

Private Sub Info_Exit(Cancel As Integer)

Forms![FCldetail_subform]!Status.SetFocus

End Sub

I get the message that the subform does not exist.

Again any help would be much appreciated.

Abay
 
A

Abay

Thank you so much for your help ... this is what finally worked

Me!FCldetail_subform.SetFocus
Me!FCldetail_subform.Form!Status.SetFocus

Supplied by Rural Guy ... again thank you for your help.

Abay

Abay said:
Thanks for your reply ... I have the following code in the "on exit" event
of my last field on the Master form:

Me.[FCldetail_subform].Form![Status].SetFocus

No error message, but the focus goes to the first field on the Master.

Just about ready to give up on this .. many thanks again for your help.

Abay

Ofer said:
The right syntax to refer to field in the subform will be
Forms![MainFormName]![SubFormName].Form![FieldName].SetFocus

And if you refer from the main form

Me.[SubFormName].Form![FieldName].setFocus


--
In God We Trust - Everything Else We Test


Abay said:
The following works fine in reference to a field on the Master form

Forms!Fclient_and_sub!Cname.SetFocus

But when I reference a field on the sub form from the Master form the
following doesn't work.

Private Sub Info_Exit(Cancel As Integer)

Forms![FCldetail_subform]!Status.SetFocus

End Sub

I get the message that the subform does not exist.

Again any help would be much appreciated.

Abay
 
Top