Subform Problems

D

Derek Brown

Hi All

I have two subforms on a main form that access the same table via the same
query. One is always visable while the other is hidden and their visability
can be swapped around. Wierd So far?. One subform is placed over the other
and shows all records in continuous form view. The other shows a full page
view of one record at a time with record navigation buttons. I want to be
able to keep a note of the Bookmark of the current selected record in the
first Subform then switch to the second subform and find the same bookmarked
record.

Help!
 
T

tina

if both subforms are loaded when the main form opens, then you should be
able to refer directly to the current record in one subform, from the other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the code
running within the "to" subform.

hth
 
D

Derek Brown

Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million
 
T

tina

okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

tina said:
if both subforms are loaded when the main form opens, then you should be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the code
running within the "to" subform.

hth
 
D

Derek Brown

Thank you

That's perfect

tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

tina said:
if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want to be
able to keep a note of the Bookmark of the current selected record in the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 
T

tina

you're welcome :)


Derek Brown said:
Thank you

That's perfect

tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want
to
be
able to keep a note of the Bookmark of the current selected record
in
the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 
D

Derek Brown

Thank you Tina

Thats Brilliant!! Had to put in some extra or program falls over when the
command button is clicked when the current record is a new record.

If isnull (Current record ID) = False then

Me.Parent etc

tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

tina said:
if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want to be
able to keep a note of the Bookmark of the current selected record in the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 
T

tina

good job, glad it's working for you! :)


Derek Brown said:
Thank you Tina

Thats Brilliant!! Had to put in some extra or program falls over when the
command button is clicked when the current record is a new record.

If isnull (Current record ID) = False then

Me.Parent etc

tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want
to
be
able to keep a note of the Bookmark of the current selected record
in
the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 
D

Derek Brown

Thank you Tina that was just the job!!!

tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

tina said:
if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want to be
able to keep a note of the Bookmark of the current selected record in the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 
D

Derek Brown

Jeepers!!!!

I Didn't thank you for your help. Worked a treet

Please accept my apologies, although by now I'm sure it's too late.


tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

tina said:
if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want to be
able to keep a note of the Bookmark of the current selected record in the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 
T

tina

you did thank me previously, Derek, three times in fact. and you're welcome
now, as you were then. Merry Christmas! :)


Derek Brown said:
Jeepers!!!!

I Didn't thank you for your help. Worked a treet

Please accept my apologies, although by now I'm sure it's too late.


tina said:
okay, let's take the following scenario: the main form is open, and Sub1
has the focus. you select a specific record in Sub1, and then click the
command button in Sub1's header section. try the following code in the
command button's click event, as

Me.Parent!Sub2.Visible = True
Me.Parent!Sub2.SetFocus
Me.Parent!Sub1.Visible = False
Me.Parent!Sub2.Form.Recordset.FindFirst "NoteID = " & Me!NoteID

so you show the second subform's container control, and set the focus
there,
and then hide the first subform's container control. the *code* is still
running from the first subform's module, so Me!NoteID refers to the key
field on the first subform. i haven't tested this, so try it out and if
you
run into problems then post back, and we'll work it out.

btw, note that Sub1 and Sub2 refer to the names of the subform controls on
the main form - not the names of the subform form objects as seen in the
database window. sometimes the names are the same, and sometimes they're
different. to be sure you're referring to the correct name of the
container
control for each subform, do the following: open the main form in design
view. click on Sub1 once, within the main form, to select it. in the
Properties box, click on the Other tab and look at the Name property. do
the
same with Sub2 to get its' correct container control name.

hth


Derek Brown said:
Thanks Tina

Can you spell it out. I need the code for a command button on the from form
straight to the other subform. Would you mind I have been trying to
figure
it for hours!

These are a few of the many I have tried. Also below is code for making one
form visible and the other invisible. I have had to do it this way
because
according to error messages I cannot set the visible property of a form
while it still has the focus.

NoteID is the Key Field

Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub2].Form.Visible = True
Forms!MainForm!AnyField.SetFocus
Forms![MainForm]![Sub1].Form.Visible = False
'Me.Recordset.FindFirst "NoteID = " & Me.Parent!Sub2!NoteID
'Me.Parent!Sub2!NoteID = "NoteID = " & Me.Recordset.FindFirst
Me.Parent!Sub2!NoteID.Recordset.FindFirst "NoteID = " & Me.NoteID

Thanks a million

if both subforms are loaded when the main form opens, then you should
be
able to refer directly to the current record in one subform, from the
other
subform. just do a Find action on one subform's Recordset, using the value
of the primary key field from the other subform, as

Me.Recordset.FindFirst "PrimaryKeyField = " &
Me.Parent!OtherSubformControlName!PrimaryKeyField

the above goes all on one line. the exact syntax depends on where
you're
running the code from - the mainform? or the subform you're moving *from*?
or the subform you're moving *to*? the code example is based on the
code
running within the "to" subform.

hth


Hi All

I have two subforms on a main form that access the same table via the
same
query. One is always visable while the other is hidden and their
visability
can be swapped around. Wierd So far?. One subform is placed over the
other
and shows all records in continuous form view. The other shows a full
page
view of one record at a time with record navigation buttons. I want
to
be
able to keep a note of the Bookmark of the current selected record
in
the
first Subform then switch to the second subform and find the same
bookmarked
record.

Help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top