Next record on parent form after update of child form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I posted a similar message yesterday but don't think I posed the question
properly.

After adding/editing a record to a sub/sub form I'd like to move to the next
record of the main form by using the on click event of a button on the
sub/sub. I've tried to set focus and move control to the main form from the
sub then goto next record but either those are not the appropriate tools or
my syntax is bad.

Are there special considerations when moving back from sub to main.

What I'm trying to accomplish can be done by clicking on the next record
button of the main form but one would think it would be easy to do
programatically.

I'd think this would be a fairly common funtion for anyone inputing data
into a subform.

Bill
 
The code that you are using to move to the next record, you mantion that you
are setting the focus to the main form. instead set the focus to a field in
the main form and then move to the next record

Forms![MainFormName]![FieldName].SetFocus
DoCmd.GoToRecord , , acNext
 
Thanks Ofer, I'll try that now. I did something similar but didn't use the
brackets as you have illustrated. I was correct. The method and tools were
proper but the syntax was not.

By the way, that's a pretty Christian message. I appreciate it.

Ofer said:
The code that you are using to move to the next record, you mantion that you
are setting the focus to the main form. instead set the focus to a field in
the main form and then move to the next record

Forms![MainFormName]![FieldName].SetFocus
DoCmd.GoToRecord , , acNext

--
In God We Trust - Everything Else We Test


Bill said:
I posted a similar message yesterday but don't think I posed the question
properly.

After adding/editing a record to a sub/sub form I'd like to move to the next
record of the main form by using the on click event of a button on the
sub/sub. I've tried to set focus and move control to the main form from the
sub then goto next record but either those are not the appropriate tools or
my syntax is bad.

Are there special considerations when moving back from sub to main.

What I'm trying to accomplish can be done by clicking on the next record
button of the main form but one would think it would be easy to do
programatically.

I'd think this would be a fairly common funtion for anyone inputing data
into a subform.

Bill
 
Ofer,

RTE 438 - Object doesn't support this property or method.

As I said this is exactly what I was trying to do previously. The only
difference was the brackets around the form and control names.

Forms![frmEnterLeadResult]![PresOwner].SetFocus
DoCmd.GoToRecord , , acNext

Ofer said:
The code that you are using to move to the next record, you mantion that you
are setting the focus to the main form. instead set the focus to a field in
the main form and then move to the next record

Forms![MainFormName]![FieldName].SetFocus
DoCmd.GoToRecord , , acNext

--
In God We Trust - Everything Else We Test


Bill said:
I posted a similar message yesterday but don't think I posed the question
properly.

After adding/editing a record to a sub/sub form I'd like to move to the next
record of the main form by using the on click event of a button on the
sub/sub. I've tried to set focus and move control to the main form from the
sub then goto next record but either those are not the appropriate tools or
my syntax is bad.

Are there special considerations when moving back from sub to main.

What I'm trying to accomplish can be done by clicking on the next record
button of the main form but one would think it would be easy to do
programatically.

I'd think this would be a fairly common funtion for anyone inputing data
into a subform.

Bill
 
Sorry if this is a dupe but my screen just left me.

Anyway,

Tried and got RTE 438 - Object doesn't support property or method. Here's
the code. Don't forget this event is in a sub/sub (subform on subform on
form). Do you think that makes a difference?

Forms![frmEnterLeadResult]![PresOwner].SetFocus
DoCmd.GoToRecord , , acNext

Ofer said:
The code that you are using to move to the next record, you mantion that you
are setting the focus to the main form. instead set the focus to a field in
the main form and then move to the next record

Forms![MainFormName]![FieldName].SetFocus
DoCmd.GoToRecord , , acNext

--
In God We Trust - Everything Else We Test


Bill said:
I posted a similar message yesterday but don't think I posed the question
properly.

After adding/editing a record to a sub/sub form I'd like to move to the next
record of the main form by using the on click event of a button on the
sub/sub. I've tried to set focus and move control to the main form from the
sub then goto next record but either those are not the appropriate tools or
my syntax is bad.

Are there special considerations when moving back from sub to main.

What I'm trying to accomplish can be done by clicking on the next record
button of the main form but one would think it would be easy to do
programatically.

I'd think this would be a fairly common funtion for anyone inputing data
into a subform.

Bill
 
Do you have any other records to move to?
If you open the main form with a filter, then you have no other records to
move to, and this is why you can get this message.
Stand on the field on the main form, and press page down, see if you move to
a next record, or to a new one.


--
In God We Trust - Everything Else We Test


Bill said:
Sorry if this is a dupe but my screen just left me.

Anyway,

Tried and got RTE 438 - Object doesn't support property or method. Here's
the code. Don't forget this event is in a sub/sub (subform on subform on
form). Do you think that makes a difference?

Forms![frmEnterLeadResult]![PresOwner].SetFocus
DoCmd.GoToRecord , , acNext

Ofer said:
The code that you are using to move to the next record, you mantion that you
are setting the focus to the main form. instead set the focus to a field in
the main form and then move to the next record

Forms![MainFormName]![FieldName].SetFocus
DoCmd.GoToRecord , , acNext

--
In God We Trust - Everything Else We Test


Bill said:
I posted a similar message yesterday but don't think I posed the question
properly.

After adding/editing a record to a sub/sub form I'd like to move to the next
record of the main form by using the on click event of a button on the
sub/sub. I've tried to set focus and move control to the main form from the
sub then goto next record but either those are not the appropriate tools or
my syntax is bad.

Are there special considerations when moving back from sub to main.

What I'm trying to accomplish can be done by clicking on the next record
button of the main form but one would think it would be easy to do
programatically.

I'd think this would be a fairly common funtion for anyone inputing data
into a subform.

Bill
 
Offer,

I can indeed move to the next record when I'm on the main form and hit page
down. For a minute I thought I had the answer in that initially this couldn't
be done. The form was so long it took me to a blank page. After I shortened
the form to fit on one page I could do it. However the code did not work. I
still get a message "Object does not support this property or method".

I've tripple checked to ensure these field and form names are correct.

Forms![frmEnterLeadResult]![PresOwner].SetFocus
DoCmd.GoToRecord , , acNext

Ofer said:
Do you have any other records to move to?
If you open the main form with a filter, then you have no other records to
move to, and this is why you can get this message.
Stand on the field on the main form, and press page down, see if you move to
a next record, or to a new one.


--
In God We Trust - Everything Else We Test


Bill said:
Sorry if this is a dupe but my screen just left me.

Anyway,

Tried and got RTE 438 - Object doesn't support property or method. Here's
the code. Don't forget this event is in a sub/sub (subform on subform on
form). Do you think that makes a difference?

Forms![frmEnterLeadResult]![PresOwner].SetFocus
DoCmd.GoToRecord , , acNext

Ofer said:
The code that you are using to move to the next record, you mantion that you
are setting the focus to the main form. instead set the focus to a field in
the main form and then move to the next record

Forms![MainFormName]![FieldName].SetFocus
DoCmd.GoToRecord , , acNext

--
In God We Trust - Everything Else We Test


:

I posted a similar message yesterday but don't think I posed the question
properly.

After adding/editing a record to a sub/sub form I'd like to move to the next
record of the main form by using the on click event of a button on the
sub/sub. I've tried to set focus and move control to the main form from the
sub then goto next record but either those are not the appropriate tools or
my syntax is bad.

Are there special considerations when moving back from sub to main.

What I'm trying to accomplish can be done by clicking on the next record
button of the main form but one would think it would be easy to do
programatically.

I'd think this would be a fairly common funtion for anyone inputing data
into a subform.

Bill
 
Back
Top