Please Help! Subform Headache

  • Thread starter Thread starter Sonya
  • Start date Start date
S

Sonya

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.
I tried the below answer, but wasn't what I needed.
Thank you in advance for your help.
-----Original Message-----
Not real clear on what you are asking but it sounds like
if you want the subforms to show any data, and not just
data that "Matches" the main form then open the form in
design view and click on the subform to access the
subform controls properties. Remove the parent, master
link field criteria. Your forms will now work
individually. Danger: any information entered in
subform will no longer be associated with the main forms
recordsource unless you enter the value for the field
that relates the two records manually. Dont know if this
is clear enough. HTH

I have a main form w/ 2 subforms. When I enter data in
the 1st and 2nd subform, they work simutaneously. I
cannot see the information I entered in the 2nd subform
unless I click on the corresponding line on the 1st
subform. How can I get the subforms to work
separtely? I want to be able to veiw the info for each
subform separte. I hope this make sense.
..
 
---------- "Sonya said:
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.
I tried the below answer, but wasn't what I needed.
Thank you in advance for your help.

Sonya,

what is the data structure behind the forms (please give the exact
names of tables and fields)? What relationships do you have, and what
are the Recordsources of the forms (please post the SQL)?

Also, is there some code in the 1st subform's Current event?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Emilia,
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 is no 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. Thanks for trying to help.
I am about to lose it w/ this database.
 
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

Paul
-----Original Message-----
Emilia,
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 is no 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. Thanks for trying to help.
I am about to lose it w/ this database.
-----Original Message-----


Sonya,

what is the data structure behind the forms (please give the exact
names of tables and fields)? What relationships do you have, and what
are the Recordsources of the forms (please post the SQL)?

Also, is there some code in the 1st subform's Current event?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
.
.
 
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

Paul
-----Original Message-----
Emilia,
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 is no 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. Thanks for trying to help.
I am about to lose it w/ this database.
-----Original Message-----
---------- "Sonya"
give
the exact
.
.
 
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
Sonya said:
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

Paul
-----Original Message-----
Emilia,
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 is no 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. Thanks for trying to help.
I am about to lose it w/ this database.

-----Original Message-----
---------- "Sonya"
wrote:

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.
I tried the below answer, but wasn't what I needed.
Thank you in advance for your help.

Sonya,

what is the data structure behind the forms (please give
the exact
names of tables and fields)? What relationships do you
have, and what
are the Recordsources of the forms (please post the SQL)?

Also, is there some code in the 1st subform's Current
event?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
.

.
.
 
I followed your instructions 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
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

Paul
-----Original Message-----
Emilia,
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 is no 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. Thanks for trying to help.
I am about to lose it w/ this database.

-----Original Message-----
---------- "Sonya"
wrote:

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.
I tried the below answer, but wasn't what I needed.
Thank you in advance for your help.

Sonya,

what is the data structure behind the forms (please give
the exact
names of tables and fields)? What relationships do you
have, and what
are the Recordsources of the forms (please post the SQL)?

Also, is there some code in the 1st subform's Current
event?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
.

.

.


.
 
Yes. It sound like the two tables are related and Inmate cell search
requires the Inmate Id field to be present with the Inmate ID information
you are entering in the current subform. Open the relationship window and
remove the relationship between those two tables. The only relationships
should be Inmate information, Inmate cell search, and Inmate information and
Inmate pat search. Since the other tables are related they require
information to exist in inmate cell search before you can enter the pat
search info. This is not the way this should be designed. The Relationship
window is opened from the Tools menu. Click on the line that connects the
two tables and delete it. if both tables are not present in this window then
right click in an open area of the window and select show all tables.
HTH
Sonya said:
I followed your instructions 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?
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
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

Paul
-----Original Message-----
Emilia,
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 is no 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. Thanks for trying to
help.
I am about to lose it w/ this database.

-----Original Message-----
---------- "Sonya"
<[email protected]>
wrote:

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.
I tried the below answer, but wasn't what I needed.
Thank you in advance for your help.

Sonya,

what is the data structure behind the forms (please
give
the exact
names of tables and fields)? What relationships do you
have, and what
are the Recordsources of the forms (please post the
SQL)?

Also, is there some code in the 1st subform's Current
event?

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
.

.

.


.
 
Back
Top