Help with Subform References

C

Chaplain Doug

I have a main form that is a tab control with five pages
(tabs). The main form is called [Male Program Records].
On one of the pages of the tab control I have two subforms
displayed. One is called [Select Male Participant
Records] and the other is called [Selected Male
Participant Records]. After one of the controls in
[Select Male Participant Records] is updated (the Update
event) I try to run code that does a requery on the other
subform. I am using:

Private Sub SELECTED_AfterUpdate()
[Selected Male Participant Records].Requery
End Sub

The error message I get is:

Microsoft Access can't find the field "|" referred to in
your expression.

Questions:

1. What's wrong with the reference to the other subform?
2. What is the proper way to reference the other subform
([Selected Male Participant Records])?

Thanks for any help. God bless.
 
A

Allen Browne

Doug, the pipe character indicates that Access cannot resolve the name of
something. That could be because of an ambiguity, a corruption, etc.

1. Open the main form in design view.

2. Right-click the edge of the subform named
[Selected Male Participant Records]
and choose Properties.

3. What is in the LinkMasterFields and LinkChildFields properties?

If it includes a field that conflicts with an existing name, the field will
need to be renamed. Examples of bad names:
- Name (forms have a Name),
- Section (forms have sections),
- Date (used for system date)

Note: You may need to turn off the Name AutoCorrect options (Tools | Options
| General) and compact before you are able to trace some of these names.
 
C

Chaplain Doug

Dear Allen:

I think my problem is that I am referencing the subform
instead of the subform control. When I use:

Forms!NameOfMainForm!NameOfSubformControl.Form!
NameOfControl

Then it works. (By the way, this was given to me in an
answer to another post). Thanks for all the times you
have answered my questions, especially at an hour like
this! You are indeed a help and a blessing.

-----Original Message-----
Doug, the pipe character indicates that Access cannot resolve the name of
something. That could be because of an ambiguity, a corruption, etc.

1. Open the main form in design view.

2. Right-click the edge of the subform named
[Selected Male Participant Records]
and choose Properties.

3. What is in the LinkMasterFields and LinkChildFields properties?

If it includes a field that conflicts with an existing name, the field will
need to be renamed. Examples of bad names:
- Name (forms have a Name),
- Section (forms have sections),
- Date (used for system date)

Note: You may need to turn off the Name AutoCorrect options (Tools | Options
| General) and compact before you are able to trace some of these names.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a main form that is a tab control with five pages
(tabs). The main form is called [Male Program Records].
On one of the pages of the tab control I have two subforms
displayed. One is called [Select Male Participant
Records] and the other is called [Selected Male
Participant Records]. After one of the controls in
[Select Male Participant Records] is updated (the Update
event) I try to run code that does a requery on the other
subform. I am using:

Private Sub SELECTED_AfterUpdate()
[Selected Male Participant Records].Requery
End Sub

The error message I get is:

Microsoft Access can't find the field "|" referred to in
your expression.

Questions:

1. What's wrong with the reference to the other subform?
2. What is the proper way to reference the other subform
([Selected Male Participant Records])?

Thanks for any help. God bless.


.
 

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