SetFocus to field on new form - Access 2000

A

Abay

I have a multi-table Master/detail form. I would like to tab to the first
field on the detail form from the last field on the Master, which was
working .. but now when I tab from the last field on the Master after
tabbing 4 times (going nowhere) the focus goes back to the first field on
the master.

I have tried to set focus to the first field on the detail form with no
success. It seems it should be an easy thing to do (and probably is) but it
escapes me .. any help would be much appreciated.

Thanks,
Abay
 
R

RuralGuy

I have a multi-table Master/detail form. I would like to tab to the first
field on the detail form from the last field on the Master, which was
working .. but now when I tab from the last field on the Master after
tabbing 4 times (going nowhere) the focus goes back to the first field on
the master.

I have tried to set focus to the first field on the detail form with no
success. It seems it should be an easy thing to do (and probably is) but it
escapes me .. any help would be much appreciated.

Thanks,
Abay

You must set the focus to the SubFormControl on the main form first
before setting the focus to a control on the SubForm.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
A

Abay

Thank you for your reply, and please excuse my ignorance, but how do I do
that .. I have tried variations of the code below, but am not getting the
syntax? right. Am a bit of a newbie, only having the opportunity to use
Access now and again. My reference guide is "Using VB for Access97 Step by
Step", which goes through the basics. Any suggestions on other reference
manuals would be much appreciated as would some more help here.

Private Sub Info_AfterUpdate()
[FCldetail_SubForm.Status].SetFocus

Note "Info" is the last field on the master form, Status is the first field
on the sub form.

Thanks again,
Abay
 
R

RuralGuy

You need to use the "Me" reference to begin with. Then you must set
the focus to the SubFormControl first. THis is *not* the SubForm but
the SubFormControl on the main form that displays the SubForm. Your
sequence will be something like:

Me.SubFormControl.SetFocus
Me.SubFormControl.Form.Status.SetFocus

You'll have to use your name for the SubFormControl. It does not have
to be the same name as the SubForm but usually is because most people
use the Wizard to add the SubForm and accept the defaults.

Thank you for your reply, and please excuse my ignorance, but how do I do
that .. I have tried variations of the code below, but am not getting the
syntax? right. Am a bit of a newbie, only having the opportunity to use
Access now and again. My reference guide is "Using VB for Access97 Step by
Step", which goes through the basics. Any suggestions on other reference
manuals would be much appreciated as would some more help here.

Private Sub Info_AfterUpdate()
[FCldetail_SubForm.Status].SetFocus

Note "Info" is the last field on the master form, Status is the first field
on the sub form.

Thanks again,
Abay

You must set the focus to the SubFormControl on the main form first
before setting the focus to a control on the SubForm.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
A

Abay

Thank you again .. I did the following without success:

Private Sub Info_Exit(Cancel As Integer)

Me.Cname.SetFocus .. this works fine
Me.Cname.FCldetail_subform.Status.SetFocus .. this obviously gives an
error, except it's not obvious to me.. unfortunately

End Sub

This produces the error: "Method or data member not found"

Note: I did use the Wizard .. Cname is the link (I assume that is the
Control you reference) between the two forms and the detail form is called
FCldetail_subform

I feel really frustrated with my ignorance, & apologies for same. I'll have
no hair left if I don't get it right soon!

Abay


You need to use the "Me" reference to begin with. Then you must set
the focus to the SubFormControl first. THis is *not* the SubForm but
the SubFormControl on the main form that displays the SubForm. Your
sequence will be something like:

Me.SubFormControl.SetFocus
Me.SubFormControl.Form.Status.SetFocus

You'll have to use your name for the SubFormControl. It does not have
to be the same name as the SubForm but usually is because most people
use the Wizard to add the SubForm and accept the defaults.

Thank you for your reply, and please excuse my ignorance, but how do I do
that .. I have tried variations of the code below, but am not getting the
syntax? right. Am a bit of a newbie, only having the opportunity to use
Access now and again. My reference guide is "Using VB for Access97 Step
by
Step", which goes through the basics. Any suggestions on other reference
manuals would be much appreciated as would some more help here.

Private Sub Info_AfterUpdate()
[FCldetail_SubForm.Status].SetFocus

Note "Info" is the last field on the master form, Status is the first
field
on the sub form.

Thanks again,
Abay

I have a multi-table Master/detail form. I would like to tab to the
first
field on the detail form from the last field on the Master, which was
working .. but now when I tab from the last field on the Master after
tabbing 4 times (going nowhere) the focus goes back to the first field
on
the master.

I have tried to set focus to the first field on the detail form with no
success. It seems it should be an easy thing to do (and probably is)
but
it
escapes me .. any help would be much appreciated.

Thanks,
Abay


You must set the focus to the SubFormControl on the main form first
before setting the focus to a control on the SubForm.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

Add 1 more Form to this: Me.Cname.FCldetail_subform.Status.SetFocus
so it becomes : Me.Cname.FCldetail_subform.Form.Status.SetFocus

Thank you again .. I did the following without success:

Private Sub Info_Exit(Cancel As Integer)

Me.Cname.SetFocus .. this works fine
Me.Cname.FCldetail_subform.Status.SetFocus .. this obviously gives an
error, except it's not obvious to me.. unfortunately

End Sub

This produces the error: "Method or data member not found"

Note: I did use the Wizard .. Cname is the link (I assume that is the
Control you reference) between the two forms and the detail form is called
FCldetail_subform

I feel really frustrated with my ignorance, & apologies for same. I'll have
no hair left if I don't get it right soon!

Abay


You need to use the "Me" reference to begin with. Then you must set
the focus to the SubFormControl first. THis is *not* the SubForm but
the SubFormControl on the main form that displays the SubForm. Your
sequence will be something like:

Me.SubFormControl.SetFocus
Me.SubFormControl.Form.Status.SetFocus

You'll have to use your name for the SubFormControl. It does not have
to be the same name as the SubForm but usually is because most people
use the Wizard to add the SubForm and accept the defaults.

Thank you for your reply, and please excuse my ignorance, but how do I do
that .. I have tried variations of the code below, but am not getting the
syntax? right. Am a bit of a newbie, only having the opportunity to use
Access now and again. My reference guide is "Using VB for Access97 Step
by
Step", which goes through the basics. Any suggestions on other reference
manuals would be much appreciated as would some more help here.

Private Sub Info_AfterUpdate()
[FCldetail_SubForm.Status].SetFocus

Note "Info" is the last field on the master form, Status is the first
field
on the sub form.

Thanks again,
Abay

<RuralGuy> wrote in message

I have a multi-table Master/detail form. I would like to tab to the
first
field on the detail form from the last field on the Master, which was
working .. but now when I tab from the last field on the Master after
tabbing 4 times (going nowhere) the focus goes back to the first field
on
the master.

I have tried to set focus to the first field on the detail form with no
success. It seems it should be an easy thing to do (and probably is)
but
it
escapes me .. any help would be much appreciated.

Thanks,
Abay


You must set the focus to the SubFormControl on the main form first
before setting the focus to a control on the SubForm.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

I just noticed the other error. Here's the two lines of code you
need:

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

Copy it exactly as written and try it.

Thank you again .. I did the following without success:

Private Sub Info_Exit(Cancel As Integer)

Me.Cname.SetFocus .. this works fine
Me.Cname.FCldetail_subform.Status.SetFocus .. this obviously gives an
error, except it's not obvious to me.. unfortunately

End Sub

This produces the error: "Method or data member not found"

Note: I did use the Wizard .. Cname is the link (I assume that is the
Control you reference) between the two forms and the detail form is called
FCldetail_subform

I feel really frustrated with my ignorance, & apologies for same. I'll have
no hair left if I don't get it right soon!

Abay


You need to use the "Me" reference to begin with. Then you must set
the focus to the SubFormControl first. THis is *not* the SubForm but
the SubFormControl on the main form that displays the SubForm. Your
sequence will be something like:

Me.SubFormControl.SetFocus
Me.SubFormControl.Form.Status.SetFocus

You'll have to use your name for the SubFormControl. It does not have
to be the same name as the SubForm but usually is because most people
use the Wizard to add the SubForm and accept the defaults.

Thank you for your reply, and please excuse my ignorance, but how do I do
that .. I have tried variations of the code below, but am not getting the
syntax? right. Am a bit of a newbie, only having the opportunity to use
Access now and again. My reference guide is "Using VB for Access97 Step
by
Step", which goes through the basics. Any suggestions on other reference
manuals would be much appreciated as would some more help here.

Private Sub Info_AfterUpdate()
[FCldetail_SubForm.Status].SetFocus

Note "Info" is the last field on the master form, Status is the first
field
on the sub form.

Thanks again,
Abay

<RuralGuy> wrote in message

I have a multi-table Master/detail form. I would like to tab to the
first
field on the detail form from the last field on the Master, which was
working .. but now when I tab from the last field on the Master after
tabbing 4 times (going nowhere) the focus goes back to the first field
on
the master.

I have tried to set focus to the first field on the detail form with no
success. It seems it should be an easy thing to do (and probably is)
but
it
escapes me .. any help would be much appreciated.

Thanks,
Abay


You must set the focus to the SubFormControl on the main form first
before setting the focus to a control on the SubForm.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
A

Abay

Eureka it works!

Many many thanks for your continued help .. very much appreciated

Abay

I just noticed the other error. Here's the two lines of code you
need:

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

Copy it exactly as written and try it.

Thank you again .. I did the following without success:

Private Sub Info_Exit(Cancel As Integer)

Me.Cname.SetFocus .. this works fine
Me.Cname.FCldetail_subform.Status.SetFocus .. this obviously gives an
error, except it's not obvious to me.. unfortunately

End Sub

This produces the error: "Method or data member not found"

Note: I did use the Wizard .. Cname is the link (I assume that is the
Control you reference) between the two forms and the detail form is called
FCldetail_subform

I feel really frustrated with my ignorance, & apologies for same. I'll
have
no hair left if I don't get it right soon!

Abay


You need to use the "Me" reference to begin with. Then you must set
the focus to the SubFormControl first. THis is *not* the SubForm but
the SubFormControl on the main form that displays the SubForm. Your
sequence will be something like:

Me.SubFormControl.SetFocus
Me.SubFormControl.Form.Status.SetFocus

You'll have to use your name for the SubFormControl. It does not have
to be the same name as the SubForm but usually is because most people
use the Wizard to add the SubForm and accept the defaults.


Thank you for your reply, and please excuse my ignorance, but how do I
do
that .. I have tried variations of the code below, but am not getting
the
syntax? right. Am a bit of a newbie, only having the opportunity to use
Access now and again. My reference guide is "Using VB for Access97 Step
by
Step", which goes through the basics. Any suggestions on other
reference
manuals would be much appreciated as would some more help here.

Private Sub Info_AfterUpdate()
[FCldetail_SubForm.Status].SetFocus

Note "Info" is the last field on the master form, Status is the first
field
on the sub form.

Thanks again,
Abay

<RuralGuy> wrote in message

I have a multi-table Master/detail form. I would like to tab to the
first
field on the detail form from the last field on the Master, which was
working .. but now when I tab from the last field on the Master after
tabbing 4 times (going nowhere) the focus goes back to the first field
on
the master.

I have tried to set focus to the first field on the detail form with
no
success. It seems it should be an easy thing to do (and probably is)
but
it
escapes me .. any help would be much appreciated.

Thanks,
Abay


You must set the focus to the SubFormControl on the main form first
before setting the focus to a control on the SubForm.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.


_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Top