changing bookmark in subform from another subform

R

Renee

I have a form that contains two subforms. I'm trying to
synchronize the two subforms so that when a different
record is selected in one, that same record is selected
in the other. I've tried putting the following code in
the first subform, but I keep getting an error:

Private Sub Form_Current()

Forms.frmUpdateProject.EditUpdateProject.Form.Bookmark =
Me.Bookmark

End Sub

The name of my main form is frmUpdateProject and the
control that contains the 2nd subform is
EditUpdateProject. The error I get is Runtime 2455: You
entered an expression that has an invalid reference to
the property Form/Report.

Thanks for any advice you can give me!
 
E

Eric Butts [MSFT]

Hi,

Here's a related article but it applies to Form and subForm NOT subForm and
subForm
http://support.microsoft.com/default.aspx?scid=KB;EN-US;210060

What I would recommend you try the following instead:

- Base SubForm2 on a query (use the builder for the RecordSource) that
has for it's criteria

Forms![main form]![subForm1].Form![ID]

- And for the OnCurrent Event of subForm1 have the following

Forms![main form]![subForm2 control].requery


I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights



--------------------
| Content-Class: urn:content-classes:message
| From: "Renee" <[email protected]>
| Sender: "Renee" <[email protected]>
| Subject: changing bookmark in subform from another subform
| Date: Wed, 16 Jun 2004 09:44:40 -0700
| Lines: 20
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcRTwTgfDNl/c6bqT+6KKXivGmMnXg==
| Newsgroups: microsoft.public.access.formscoding
| Path: cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.formscoding:236084
| NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I have a form that contains two subforms. I'm trying to
| synchronize the two subforms so that when a different
| record is selected in one, that same record is selected
| in the other. I've tried putting the following code in
| the first subform, but I keep getting an error:
|
| Private Sub Form_Current()
|
| Forms.frmUpdateProject.EditUpdateProject.Form.Bookmark =
| Me.Bookmark
|
| End Sub
|
| The name of my main form is frmUpdateProject and the
| control that contains the 2nd subform is
| EditUpdateProject. The error I get is Runtime 2455: You
| entered an expression that has an invalid reference to
| the property Form/Report.
|
| Thanks for any advice you can give me!
|
 
R

Renee

Thanks for the input. I'm still having a problem,
though. In my SubForm2 query builder I'm entering

Forms![MainForm]![SubForm1].Form![ProjectID]

but it saves as

[Forms]![MainForm]![SubForm1].[Form]![ProjectID]

and then Access interprets it as a parameter and requests
input on the requery. What am I doing wrong?

Thanks!
 
E

Eric Butts [MSFT]

Hi Renee,

Is the name of the subForm Control really [SubForm1]?

I'm talking about the name of the subForm itself, just the subForm control
as it exists in the main form.

Is there a textbox control in the subForm named [ProjectID]?

The reason you get a parameter prompt is because Microsoft Access can't
find such an object, whether it's the subform control, the textbox control,
or the main Form itself.

Check the names


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Content-Class: urn:content-classes:message
| From: "Renee" <[email protected]>
| Sender: "Renee" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: changing bookmark in subform from another subform
| Date: Wed, 16 Jun 2004 21:15:08 -0700
| Lines: 14
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcRUIa0q2jyvOMjgRK+0wNosGeifbw==
| Newsgroups: microsoft.public.access.formscoding
| Path: cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.formscoding:236151
| NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| Thanks for the input. I'm still having a problem,
| though. In my SubForm2 query builder I'm entering
|
| Forms![MainForm]![SubForm1].Form![ProjectID]
|
| but it saves as
|
| [Forms]![MainForm]![SubForm1].[Form]![ProjectID]
|
| and then Access interprets it as a parameter and requests
| input on the requery. What am I doing wrong?
|
| Thanks!
|
|
 

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