Subform Dilemma

S

Sonya

My relationship between the tables are
inmateInfo (inmate #) 1-many inmate cell search (inmate #)
inmate cell search (autonumber) 1-many inmatepatsearch
(inmate #) When I try to have inmateinfo 1-many for both
my subforms, I get the error msg: "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"". When I do the relationship
below I get this error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search""

"Paul" <[email protected]>
Can you tell me the relationships between your tables

they should be :-
inmateInfo 1-many inmate cell search
inmateInfo 1-many inmatepatsearch

-----Original Message-----

I hope someone can give me the answer to this problem. I
followed the instructions below and when I enter data in
the pat searches I get an error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"" Am I doing something wrong?

-----Original Message-----
open the main form in design view. then select the
subform control by
clicking on the border once. now open the properties
dialog and set the link
child field and link master field to the inmate id #, (
you can use the ...
build button at the rightmost side of either field
(child or master) to select the fields from a list. Do
this for both subforms and you will be able to enter
data
relative to the inmate for each subform.
HTH

message Yes, that is what I want to do. Enter info in each of
my subforms concerning cell searches and/or pat searches
for each inmate. As of right now the form will not let
me add pat searches unless I have data in the cell
searches, because the pat search info links to the cell
search info. Sorry this is so confusing.

-----Original Message-----
Dear Sonya

I am trying to understand what you are trying to
achieve here. Are you tryng to filter your 2 sub-forms
based on the pertinent information on your main form? EG
If Inmate#1 is active on the main form then Sub-Form1
should show the details of cell searches relating to
Inmate#1, and Sub-Form2 should show the the details of
pat searches relating to Inmate#1.

If this is the case please post back and we will try
and help you further

Kind regards
-----Original Message-----
I am so stuck on this problem. I want my two subforms
to be connected to the main form. But when I enter
info in my 2nd subform, I can only see it if I go to the
corresponding line on the 1st subform. I want my
subforms to work independently. I also can't enter
info in my 2nd subform unless there is data in the 1st
subform. I hope I am explaining this right.
Thank you in advance for your help. Below is the
structure of my database....

Tbl 1: Inmate Info (Inmate #; Inmate Name)
Tbl 2: Inmate Cell Search (AutoNumber; Date Searched;
Inmate #; Inmate Name; Cellhouse; Cell; Bed; Reason;
U/A; Report; Staff; Start Time; Finish Time; Contraband
found)
Tbl 3: Inmate Pat Search (Date; Inmate #; Inmate
Name; Time; Staff; Location)

I can't find the SQL

Form 1: Inmate Info
record source: Inmate Info Table)

Subform 1: Inmate Cell Search Subform
record source: SELECT [Inmate Cell Search].[Auto
Number], [Inmate Cell Search].[Date Searched], [Inmate
Cell Search].[Inmate Number], [Inmate Cell Search]. [Inmate
Name], [Inmate Cell Search].CH, [Inmate Cell
Search].Cell, [Inmate Cell Search].Bed, [Inmate Cell
Search].Reason, [Inmate Cell Search].[U/A], [Inmate
Cell Search].Report, [Inmate Cell Search].[Staff # 1],
[Inmate Cell Search].[Staff # 2], [Inmate Cell Search].
[Start Time], [Inmate

Subform 2: Inmate Pat Search Subform
record source: SELECT [Inmate Pat Search].Date,
[Inmate Pat Search].[Inmate Number], [Inmate Pat
Search].Time, [Inmate Pat Search].Staff, [Inmate Pat
Search].Location FROM [Inmate Pat Search];

There's not a code on the 1st subform's Oncurrent Event.
I was thinking I needed something in the event, but
didn't know what to use.

Also, I did the subforms as a tab control. I don't
know if that makes a difference.
 
P

Paul Falla

Dear Sonya

Hopefully we can clear this up for you once and for all.
I have done a quick test to make sure that the
instructions I am about to give you do actually work, and
lo and behold we have a result!

Firstly, open your "Inmate Info" table in design veiw and
make sure that the Inmate# is set as the primary key. With
this done, open your "Inmate Info" form in design view.
Open the properties window and click on the "Inmate Cell
Search" sub form (so that it shows the eight black squares
around the edge). Click on the Data tab of the properties
window. In the Source Object field make sure that the name
of your "Inmate Cell Search" sub-form is displayed. In the
Link Child Fields field make sure that you have Inmate#
showing, and in the Link Master Fields field ensure that
Inmate# is also showing.

Now do exactly the same with the "Inmate Pat Search"
subform. Basically what we have done here is link
the "Inmate Cell Search" data to the "Inmate Info" data
via the Inmate#. Also we have linked the "Inmate Pat
Search" info to the "Inmate Info" data, again via the
Inmate#. From the previous threads, where you were going
wrong, was to link the cell search form to the Info form,
and the the pat search form to the cell search form.

If you want to test this roughly, open a new form in
design view and use the "Inmate info" table as your data
source. In the form header section of this new form, put
the fields for the inmate name and the inmate#.Now save
the form with a distinctive name (something
like "TestLinks"). In the form's properties, under the
format tab set the Default View to be Single Form. To
bring in the first subform click on the sub-form icon,
ensuring that the wizard button is depressed. When the
wizard runs, select the name of the relative subform that
you created earlier, and when asked to specify the child
parent fields, make sure that the respective Inmate#'s are
selected. Do the same with the other subform, and you
should now have a working model.

I hope I have not over simplified things for you, but from
reading your previous postings, it sounded like you need
the help before you get to the throwing the pc out of the
window stage.

If you need any more help, please feel free to post back
or email me directly.

Seasons greetings

Paul Falla
-----Original Message-----
My relationship between the tables are
inmateInfo (inmate #) 1-many inmate cell search (inmate #)
inmate cell search (autonumber) 1-many inmatepatsearch
(inmate #) When I try to have inmateinfo 1-many for both
my subforms, I get the error msg: "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"". When I do the relationship
below I get this error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search""

"Paul" <[email protected]>
Can you tell me the relationships between your tables

they should be :-
inmateInfo 1-many inmate cell search
inmateInfo 1-many inmatepatsearch

-----Original Message-----

I hope someone can give me the answer to this problem. I
followed the instructions below and when I enter data in
the pat searches I get an error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"" Am I doing something wrong?

-----Original Message-----
open the main form in design view. then select the
subform control by
clicking on the border once. now open the properties
dialog and set the link
child field and link master field to the inmate id #, (
you can use the ...
build button at the rightmost side of either field
(child or master) to select the fields from a list. Do
this for both subforms and you will be able to enter
data
relative to the inmate for each subform.
HTH

message Yes, that is what I want to do. Enter info in each of
my subforms concerning cell searches and/or pat searches
for each inmate. As of right now the form will not let
me add pat searches unless I have data in the cell
searches, because the pat search info links to the cell
search info. Sorry this is so confusing.

-----Original Message-----
Dear Sonya

I am trying to understand what you are trying to
achieve here. Are you tryng to filter your 2 sub-forms
based on the pertinent information on your main form? EG
If Inmate#1 is active on the main form then Sub-Form1
should show the details of cell searches relating to
Inmate#1, and Sub-Form2 should show the the details of
pat searches relating to Inmate#1.

If this is the case please post back and we will try
and help you further

Kind regards
-----Original Message-----
I am so stuck on this problem. I want my two subforms
to be connected to the main form. But when I enter
info in my 2nd subform, I can only see it if I go to the
corresponding line on the 1st subform. I want my
subforms to work independently. I also can't enter
info in my 2nd subform unless there is data in the 1st
subform. I hope I am explaining this right.
Thank you in advance for your help. Below is the
structure of my database....

Tbl 1: Inmate Info (Inmate #; Inmate Name)
Tbl 2: Inmate Cell Search (AutoNumber; Date Searched;
Inmate #; Inmate Name; Cellhouse; Cell; Bed; Reason;
U/A; Report; Staff; Start Time; Finish Time; Contraband
found)
Tbl 3: Inmate Pat Search (Date; Inmate #; Inmate
Name; Time; Staff; Location)

I can't find the SQL

Form 1: Inmate Info
record source: Inmate Info Table)

Subform 1: Inmate Cell Search Subform
record source: SELECT [Inmate Cell Search].[Auto
Number], [Inmate Cell Search].[Date Searched], [Inmate
Cell Search].[Inmate Number], [Inmate Cell Search]. [Inmate
Name], [Inmate Cell Search].CH, [Inmate Cell
Search].Cell, [Inmate Cell Search].Bed, [Inmate Cell
Search].Reason, [Inmate Cell Search].[U/A], [Inmate
Cell Search].Report, [Inmate Cell Search].[Staff # 1],
[Inmate Cell Search].[Staff # 2], [Inmate Cell Search].
[Start Time], [Inmate

Subform 2: Inmate Pat Search Subform
record source: SELECT [Inmate Pat Search].Date,
[Inmate Pat Search].[Inmate Number], [Inmate Pat
Search].Time, [Inmate Pat Search].Staff, [Inmate Pat
Search].Location FROM [Inmate Pat Search];

There's not a code on the 1st subform's Oncurrent Event.
I was thinking I needed something in the event, but
didn't know what to use.

Also, I did the subforms as a tab control. I don't
know if that makes a difference.

.
 
S

Sonya

Paul,

You must have read my mind about throwing the computer
out of the window : )
I tried what you said about making the Link Master &
Child fields together. When I enter data in the Pat
Search subform I get an error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"". Is there any way that I can
e-mail you this database and you could tell me what I am
doing wrong? I would really appreciate it. Thank you.

Sonya
-----Original Message-----
Dear Sonya

Hopefully we can clear this up for you once and for all.
I have done a quick test to make sure that the
instructions I am about to give you do actually work, and
lo and behold we have a result!

Firstly, open your "Inmate Info" table in design veiw and
make sure that the Inmate# is set as the primary key. With
this done, open your "Inmate Info" form in design view.
Open the properties window and click on the "Inmate Cell
Search" sub form (so that it shows the eight black squares
around the edge). Click on the Data tab of the properties
window. In the Source Object field make sure that the name
of your "Inmate Cell Search" sub-form is displayed. In the
Link Child Fields field make sure that you have Inmate#
showing, and in the Link Master Fields field ensure that
Inmate# is also showing.

Now do exactly the same with the "Inmate Pat Search"
subform. Basically what we have done here is link
the "Inmate Cell Search" data to the "Inmate Info" data
via the Inmate#. Also we have linked the "Inmate Pat
Search" info to the "Inmate Info" data, again via the
Inmate#. From the previous threads, where you were going
wrong, was to link the cell search form to the Info form,
and the the pat search form to the cell search form.

If you want to test this roughly, open a new form in
design view and use the "Inmate info" table as your data
source. In the form header section of this new form, put
the fields for the inmate name and the inmate#.Now save
the form with a distinctive name (something
like "TestLinks"). In the form's properties, under the
format tab set the Default View to be Single Form. To
bring in the first subform click on the sub-form icon,
ensuring that the wizard button is depressed. When the
wizard runs, select the name of the relative subform that
you created earlier, and when asked to specify the child
parent fields, make sure that the respective Inmate#'s are
selected. Do the same with the other subform, and you
should now have a working model.

I hope I have not over simplified things for you, but from
reading your previous postings, it sounded like you need
the help before you get to the throwing the pc out of the
window stage.

If you need any more help, please feel free to post back
or email me directly.

Seasons greetings

Paul Falla
-----Original Message-----
My relationship between the tables are
inmateInfo (inmate #) 1-many inmate cell search (inmate #)
inmate cell search (autonumber) 1-many inmatepatsearch
(inmate #) When I try to have inmateinfo 1-many for both
my subforms, I get the error msg: "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"". When I do the
relationship
below I get this error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search""

"Paul" <[email protected]>
Can you tell me the relationships between your tables

they should be :-
inmateInfo 1-many inmate cell search
inmateInfo 1-many inmatepatsearch

-----Original Message-----

I hope someone can give me the answer to this problem. I
followed the instructions below and when I enter data in
the pat searches I get an error msg "You can not add or
change a record because a related record is required in
table "Inmate Cell Search"" Am I doing something wrong?

-----Original Message-----
open the main form in design view. then select the
subform control by
clicking on the border once. now open the properties
dialog and set the link
child field and link master field to the inmate id #, (
you can use the ...
build button at the rightmost side of either field
(child or master) to select the fields from a list. Do
this for both subforms and you will be able to enter
data
relative to the inmate for each subform.
HTH

message Yes, that is what I want to do. Enter info in each of
my subforms concerning cell searches and/or pat searches
for each inmate. As of right now the form will not let
me add pat searches unless I have data in the cell
searches, because the pat search info links to the cell
search info. Sorry this is so confusing.

-----Original Message-----
Dear Sonya

I am trying to understand what you are trying to
achieve here. Are you tryng to filter your 2 sub-forms
based on the pertinent information on your main form? EG
If Inmate#1 is active on the main form then Sub-Form1
should show the details of cell searches relating to
Inmate#1, and Sub-Form2 should show the the details of
pat searches relating to Inmate#1.

If this is the case please post back and we will try
and help you further

Kind regards
-----Original Message-----
I am so stuck on this problem. I want my two subforms
to be connected to the main form. But when I enter
info in my 2nd subform, I can only see it if I go to the
corresponding line on the 1st subform. I want my
subforms to work independently. I also can't enter
info in my 2nd subform unless there is data in the 1st
subform. I hope I am explaining this right.
Thank you in advance for your help. Below is the
structure of my database....

Tbl 1: Inmate Info (Inmate #; Inmate Name)
Tbl 2: Inmate Cell Search (AutoNumber; Date Searched;
Inmate #; Inmate Name; Cellhouse; Cell; Bed; Reason;
U/A; Report; Staff; Start Time; Finish Time; Contraband
found)
Tbl 3: Inmate Pat Search (Date; Inmate #; Inmate
Name; Time; Staff; Location)

I can't find the SQL

Form 1: Inmate Info
record source: Inmate Info Table)

Subform 1: Inmate Cell Search Subform
record source: SELECT [Inmate Cell Search].[Auto
Number], [Inmate Cell Search].[Date Searched], [Inmate
Cell Search].[Inmate Number], [Inmate Cell Search]. [Inmate
Name], [Inmate Cell Search].CH, [Inmate Cell
Search].Cell, [Inmate Cell Search].Bed, [Inmate Cell
Search].Reason, [Inmate Cell Search].[U/A], [Inmate
Cell Search].Report, [Inmate Cell Search].[Staff # 1],
[Inmate Cell Search].[Staff # 2], [Inmate Cell Search].
[Start Time], [Inmate

Subform 2: Inmate Pat Search Subform
record source: SELECT [Inmate Pat Search].Date,
[Inmate Pat Search].[Inmate Number], [Inmate Pat
Search].Time, [Inmate Pat Search].Staff, [Inmate Pat
Search].Location FROM [Inmate Pat Search];

There's not a code on the 1st subform's Oncurrent Event.
I was thinking I needed something in the event, but
didn't know what to use.

Also, I did the subforms as a tab control. I don't
know if that makes a difference.

.
.
 

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

Similar Threads


Top