New received answer pleaser help!!!!

J

julie

By: julie In: microsoft.public.access


I am in the process of creating a database. In the database I have a medical
record that is assigned to each resident that we have here. You are not
allowed to assign this number to another resident which I have used to link
my two tables together. I have a table called Residents and then I have a
table called Reportable Events. I am pulling the information from the
Resident table and the Reportable Event table from a query to generate a
report. Since I am able to tie the two table together through a query then I
do not have to enter the Resident Name on the form for Reportable Events, but
what I did do was add a subform to the form with this Medical Record Number,
Resident Name to be sure that when I enter the Medical Record number it is
for the correct person. What I want the subform to do is once I enter the
Medical Record number on the form I want it to automatically show up on my
subform to validate I have the correct Medical Record Number for that person.
I opened up the subform in design view and tried to go to proprieties of the
Medical Record and then go to the tab for events and built a query like
this=Forms![Reportable Events Year 2006]![Medical Record #] received an
error like this when I try to get out The expression on enter as the event
property setting produced the following error: Mirosoft Office Access can't
find the form "Reportable Events Year 2006 referred to in a macro expression
or Visual Basic code. What are they talking about? How can I fix it so I
will not be getting this message. I appears to be working correctly on my
form but afraid that since I am receiving this message it will eventally mess
up.....Thanks Julie
 
R

Roger Carlson

It's a little hard to tell, since you didn't give the actual form and
subform names. But my guess is that you are referencing the subform
incorrectly. In order to do that, you have to reference it through the main
form. The general form of this expression is as follows:

=Forms!MainForm!SubformControl.form!Control

Where Mainform is your main form, SubformControl is the name of the subform
control on the mainform (NOT the actual name of the subform), and Control is
the name of the textbox on the subform that you want to reference.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "SubformReference.mdb" which explains in more detail and shows
how to reference various objects on subforms and subsubforms.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


julie said:
By: julie In: microsoft.public.access


I am in the process of creating a database. In the database I have a medical
record that is assigned to each resident that we have here. You are not
allowed to assign this number to another resident which I have used to link
my two tables together. I have a table called Residents and then I have a
table called Reportable Events. I am pulling the information from the
Resident table and the Reportable Event table from a query to generate a
report. Since I am able to tie the two table together through a query then I
do not have to enter the Resident Name on the form for Reportable Events, but
what I did do was add a subform to the form with this Medical Record Number,
Resident Name to be sure that when I enter the Medical Record number it is
for the correct person. What I want the subform to do is once I enter the
Medical Record number on the form I want it to automatically show up on my
subform to validate I have the correct Medical Record Number for that person.
I opened up the subform in design view and tried to go to proprieties of the
Medical Record and then go to the tab for events and built a query like
this=Forms![Reportable Events Year 2006]![Medical Record #] received an
error like this when I try to get out The expression on enter as the event
property setting produced the following error: Mirosoft Office Access can't
find the form "Reportable Events Year 2006 referred to in a macro expression
or Visual Basic code. What are they talking about? How can I fix it so I
will not be getting this message. I appears to be working correctly on my
form but afraid that since I am receiving this message it will eventally mess
up.....Thanks Julie
 
R

Roger Carlson

On second reading, I don't think you need to worry about this at all.
(Although the advice is still good and you should download the sample for
future reference.)

One of the things the subform control is designed to do is automatically
populate the foreign key field of the subform with the primary key value of
the record in the main form. It looks to me like the query in question is
just to validate that this happened. You don't really need to do that. It
WILL happen as long as you have the Link Parent/Child Properties set
correctly in your subform control.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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