A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Why is my form blank?



 
 
Thread Tools Display Modes
  #1  
Old February 2nd, 2009, 12:46 AM posted to microsoft.public.access.gettingstarted
Aria
external usenet poster
 
Posts: 150
Default Why is my form blank?

Hi,
I don’t want to post such a dumb question but I don’t know what else to do.
I could really use some help. I’m almost finished creating a my db for my
school but a situation that has been an issue all along has taken a turn for
the worse. My db tracks keys and employee info (personal and school related).
I now need to track classroom coverage for urgent/emergency situations (ex.
Teacher A is suddenly ill and needs to leave, who will cover the class?) If I
cannot find a volunteer, an administrator will have to force the issue. This
info will also be used for payroll because staff sometimes makes side deals
without informing the office and then sometimes months later, turns in a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form view,
it was blank. Well, the labels were still there but there weren’t any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName, tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON (tblEmployees.EmpID =
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON tblEmployees.EmpID =
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1 Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this part is
incorrect. I’m sorry this is so long but I wanted to post enough information
so that someone could spot what I do not see and get me back on track.

--
Aria W.
  #2  
Old February 2nd, 2009, 12:52 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Why is my form blank?

If you have a query which is not updateable, and returns no records, the
form will be blank. Scary isn't it. There are 2 remedies:

1. If you need data entry, you'll need to fix the query.
2. If you only need to retrieve data, before the form opens, run the query
and check the recordcount in code, then cancel the open if there are no
records.

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else to
do.
I could really use some help. I'm almost finished creating a my db for my
school but a situation that has been an issue all along has taken a turn
for
the worse. My db tracks keys and employee info (personal and school
related).
I now need to track classroom coverage for urgent/emergency situations
(ex.
Teacher A is suddenly ill and needs to leave, who will cover the class?)
If I
cannot find a volunteer, an administrator will have to force the issue.
This
info will also be used for payroll because staff sometimes makes side
deals
without informing the office and then sometimes months later, turns in a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form
view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,
tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON (tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1 Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this part
is
incorrect. I'm sorry this is so long but I wanted to post enough
information
so that someone could spot what I do not see and get me back on track.

--
Aria W.



  #3  
Old February 2nd, 2009, 12:57 AM posted to microsoft.public.access.gettingstarted
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Why is my form blank?

Hi Aria,
a form can be blank because:
1. the query for it does not show any records.
You can test this by making a copy of that query and opening it as a
separate query.

2. there is a filter on the form and no records match the filter.
Remove the filter and try again.

3. it is in data entry mode. Set the Data Entry property to No, and the
Allow Additions to Yes

3. there are issues with form filters that hide all records if you don't set
the Allow Additions to Yes - most of these are fixed in A2007.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else to
do.
I could really use some help. I'm almost finished creating a my db for my
school but a situation that has been an issue all along has taken a turn
for
the worse. My db tracks keys and employee info (personal and school
related).
I now need to track classroom coverage for urgent/emergency situations
(ex.
Teacher A is suddenly ill and needs to leave, who will cover the class?)
If I
cannot find a volunteer, an administrator will have to force the issue.
This
info will also be used for payroll because staff sometimes makes side
deals
without informing the office and then sometimes months later, turns in a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form
view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,
tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON (tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1 Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this part
is
incorrect. I'm sorry this is so long but I wanted to post enough
information
so that someone could spot what I do not see and get me back on track.

--
Aria W.



  #4  
Old February 2nd, 2009, 01:52 AM posted to microsoft.public.access.gettingstarted
tina
external usenet poster
 
Posts: 1,997
Default Why is my form blank?

you're making a classic "newbie" mistake. you've inner-joined three tables
in a query that will be used as the RecordSource for a data entry form.
you've found that a multi-table query is often not updateable, and for data
entry forms it's also usually not necessary. assuming that the focus of the
form is to enter records in tblCoverage, just set tblCoverage (or a query
based *only* on tblCoverage) as the form's RecordSource. you can bind the
PeriodID field to a combobox control, using tblClassSchedule as the
control's *RowSource* (not ControlSource) - that will give you access to the
values in the class schedule table. ditto this setup for the AbsenteeEmpID
field, CoverageEmpID field, and ReasonID field, in each case using the
appropriate related table as the combobox control's RowSource.

hth


"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else to

do.
I could really use some help. I'm almost finished creating a my db for my
school but a situation that has been an issue all along has taken a turn

for
the worse. My db tracks keys and employee info (personal and school

related).
I now need to track classroom coverage for urgent/emergency situations

(ex.
Teacher A is suddenly ill and needs to leave, who will cover the class?)

If I
cannot find a volunteer, an administrator will have to force the issue.

This
info will also be used for payroll because staff sometimes makes side

deals
without informing the office and then sometimes months later, turns in a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form

view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,

tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON (tblEmployees.EmpID

=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON tblEmployees.EmpID

=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1 Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this part

is
incorrect. I'm sorry this is so long but I wanted to post enough

information
so that someone could spot what I do not see and get me back on track.

--
Aria W.



  #5  
Old February 2nd, 2009, 02:02 AM posted to microsoft.public.access.gettingstarted
Aria
external usenet poster
 
Posts: 150
Default Why is my form blank?

Hi Arvin and Jeanette,
lol Yes, it *is* scary. I don't have any records yet because I'm trying to
create this form to input test data. I need data entry so how can I fix the
query? Right now, I can't test anything.
--
Aria W.


"Arvin Meyer [MVP]" wrote:

If you have a query which is not updateable, and returns no records, the
form will be blank. Scary isn't it. There are 2 remedies:

1. If you need data entry, you'll need to fix the query.
2. If you only need to retrieve data, before the form opens, run the query
and check the recordcount in code, then cancel the open if there are no
records.

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else to
do.
I could really use some help. I'm almost finished creating a my db for my
school but a situation that has been an issue all along has taken a turn
for
the worse. My db tracks keys and employee info (personal and school
related).
I now need to track classroom coverage for urgent/emergency situations
(ex.
Teacher A is suddenly ill and needs to leave, who will cover the class?)
If I
cannot find a volunteer, an administrator will have to force the issue.
This
info will also be used for payroll because staff sometimes makes side
deals
without informing the office and then sometimes months later, turns in a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form
view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,
tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON (tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1 Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this part
is
incorrect. I'm sorry this is so long but I wanted to post enough
information
so that someone could spot what I do not see and get me back on track.

--
Aria W.




  #6  
Old February 2nd, 2009, 02:53 AM posted to microsoft.public.access.gettingstarted
Aria
external usenet poster
 
Posts: 150
Default Why is my form blank?

Hi Tina,
I figured it was the query once I didn't see my form. I then tried it using
the form wizard and while I can see the controls, there are still issues
where I need help.

Here is what I have:
Recordsource--tblCoverage

txtCoverageDate

cboAbsentee Employee
Rowsource =SELECT [LastName] & ", " & [FirstName] AS LastFirst,
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [LastName] & ", " & [FirstName],
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassDescription];


cboTchrPrep (had an error here with both a control source and a rowsource,
corrected)
Rowsource =SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[TeacherPrep] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[TeacherPrep];


cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

cboClassPeriod (had an error here with both a control source and a
rowsource, corrected)
Rowsource = SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[ClassPeriod] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[ClassPeriod];


cboCoverageReasons
Rowsource = SELECT [tblCoverageReasons].[CoverageReason] FROM
tblCoverageReasons ORDER BY [tblCoverageReasons].[CoverageReason];

TxtExplanation--Explanation for cboCoverageReasons if School/District
Business or Work on site.

txtCoverageTime--I want to make this a combo box. While I understand that
you shouldn't store calculated values in your db, our bell schedule has too
many variables to make it useful.

What's happening now is that when I try to enter info into the controls the
same info is entered into the controls below (this is a continuous form).
Also when I try to close the form I get the following error message, "You
cannot add or change a record because a related record is required in
tblEmployees".


--
Aria W.


"tina" wrote:

you're making a classic "newbie" mistake. you've inner-joined three tables
in a query that will be used as the RecordSource for a data entry form.
you've found that a multi-table query is often not updateable, and for data
entry forms it's also usually not necessary. assuming that the focus of the
form is to enter records in tblCoverage, just set tblCoverage (or a query
based *only* on tblCoverage) as the form's RecordSource. you can bind the
PeriodID field to a combobox control, using tblClassSchedule as the
control's *RowSource* (not ControlSource) - that will give you access to the
values in the class schedule table. ditto this setup for the AbsenteeEmpID
field, CoverageEmpID field, and ReasonID field, in each case using the
appropriate related table as the combobox control's RowSource.

hth


"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else to

do.
I could really use some help. I'm almost finished creating a my db for my
school but a situation that has been an issue all along has taken a turn

for
the worse. My db tracks keys and employee info (personal and school

related).
I now need to track classroom coverage for urgent/emergency situations

(ex.
Teacher A is suddenly ill and needs to leave, who will cover the class?)

If I
cannot find a volunteer, an administrator will have to force the issue.

This
info will also be used for payroll because staff sometimes makes side

deals
without informing the office and then sometimes months later, turns in a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form

view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,

tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON (tblEmployees.EmpID

=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON tblEmployees.EmpID

=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1 Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this part

is
incorrect. I'm sorry this is so long but I wanted to post enough

information
so that someone could spot what I do not see and get me back on track.

--
Aria W.




  #7  
Old February 2nd, 2009, 03:50 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Why is my form blank?

The reason that queries are not updateable is usually in the Join. You are
probably trying to update the table on the wrong side of the join. By that I
mean, you are using the primary key from the wrong table. Try changing the
table that the key is coming from.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Aria" wrote in message
...
Hi Arvin and Jeanette,
lol Yes, it *is* scary. I don't have any records yet because I'm trying
to
create this form to input test data. I need data entry so how can I fix
the
query? Right now, I can't test anything.
--
Aria W.


"Arvin Meyer [MVP]" wrote:

If you have a query which is not updateable, and returns no records, the
form will be blank. Scary isn't it. There are 2 remedies:

1. If you need data entry, you'll need to fix the query.
2. If you only need to retrieve data, before the form opens, run the
query
and check the recordcount in code, then cancel the open if there are no
records.

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else to
do.
I could really use some help. I'm almost finished creating a my db for
my
school but a situation that has been an issue all along has taken a
turn
for
the worse. My db tracks keys and employee info (personal and school
related).
I now need to track classroom coverage for urgent/emergency situations
(ex.
Teacher A is suddenly ill and needs to leave, who will cover the
class?)
If I
cannot find a volunteer, an administrator will have to force the issue.
This
info will also be used for payroll because staff sometimes makes side
deals
without informing the office and then sometimes months later, turns in
a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or Work
on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form
view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,
tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN tblEmployees
ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN tblCoverage
ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON
(tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON
tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1
Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too. My
query may pull from too many tables or maybe the structure for this
part
is
incorrect. I'm sorry this is so long but I wanted to post enough
information
so that someone could spot what I do not see and get me back on track.

--
Aria W.






  #8  
Old February 3rd, 2009, 04:27 AM posted to microsoft.public.access.gettingstarted
tina
external usenet poster
 
Posts: 1,997
Default Why is my form blank?

What's happening now is that when I try to enter info into the controls
the
same info is entered into the controls below (this is a continuous form).


then i'd say your controls are *unbound* - that is, blank ControlSource. set
each control's ControlSource to the appropriate fieldname from the form's
RecordSource.
for example: cboCoverageEmployee should have the fieldname CoverageEmpID in
its' *ControlSource* property.

and let's take a look at the *RowSource* for cboCoverageEmployee:

cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

i assume that EmpID is the primary key of tblEmployees, and you've already
said that CoverageEmpID is the corresponding foreign key in tblCoverage. so
EmpID must be included in the RowSource above; go ahead and make it the
first field, because it must be the bound column of the RowSource, and the
BoundColumn property of the combobox is already defaulted to 1 (unless you
changed it). so your RowSource would be

Rowsource = SELECT [tblEmployees].[EmpID], [tblEmployees].[LastName],
[tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

you don't want the user to see the EmpID, so just set the ColumnWidths
property to "hide" the columns the user doesn't need to see. for instance,
let's say the user only needs to see LastName, FirstName. the ColumnWidths
property would be

0"; 1"; 1"; 0"; 0"; 0"

adjust the 1-inch wide columns to whatever width you need to show the
LastName and FirstName values appropriately.

follow the same logic detailed above, to correctly set the ControlSource
property and RowSource property of each combobox control, and the
ColumnWidths property, too.

hth


"Aria" wrote in message
...
Hi Tina,
I figured it was the query once I didn't see my form. I then tried it

using
the form wizard and while I can see the controls, there are still issues
where I need help.

Here is what I have:
Recordsource--tblCoverage

txtCoverageDate

cboAbsentee Employee
Rowsource =SELECT [LastName] & ", " & [FirstName] AS LastFirst,
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [LastName] & ", " &

[FirstName],
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassDescription];


cboTchrPrep (had an error here with both a control source and a rowsource,
corrected)
Rowsource =SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[TeacherPrep] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[TeacherPrep];


cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

cboClassPeriod (had an error here with both a control source and a
rowsource, corrected)
Rowsource = SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[ClassPeriod] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[ClassPeriod];


cboCoverageReasons
Rowsource = SELECT [tblCoverageReasons].[CoverageReason] FROM
tblCoverageReasons ORDER BY [tblCoverageReasons].[CoverageReason];

TxtExplanation--Explanation for cboCoverageReasons if School/District
Business or Work on site.

txtCoverageTime--I want to make this a combo box. While I understand that
you shouldn't store calculated values in your db, our bell schedule has

too
many variables to make it useful.

What's happening now is that when I try to enter info into the controls

the
same info is entered into the controls below (this is a continuous form).
Also when I try to close the form I get the following error message, "You
cannot add or change a record because a related record is required in
tblEmployees".


--
Aria W.


"tina" wrote:

you're making a classic "newbie" mistake. you've inner-joined three

tables
in a query that will be used as the RecordSource for a data entry form.
you've found that a multi-table query is often not updateable, and for

data
entry forms it's also usually not necessary. assuming that the focus of

the
form is to enter records in tblCoverage, just set tblCoverage (or a

query
based *only* on tblCoverage) as the form's RecordSource. you can bind

the
PeriodID field to a combobox control, using tblClassSchedule as the
control's *RowSource* (not ControlSource) - that will give you access to

the
values in the class schedule table. ditto this setup for the

AbsenteeEmpID
field, CoverageEmpID field, and ReasonID field, in each case using the
appropriate related table as the combobox control's RowSource.

hth


"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else

to
do.
I could really use some help. I'm almost finished creating a my db for

my
school but a situation that has been an issue all along has taken a

turn
for
the worse. My db tracks keys and employee info (personal and school

related).
I now need to track classroom coverage for urgent/emergency situations

(ex.
Teacher A is suddenly ill and needs to leave, who will cover the

class?)
If I
cannot find a volunteer, an administrator will have to force the

issue.
This
info will also be used for payroll because staff sometimes makes side

deals
without informing the office and then sometimes months later, turns in

a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or

Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form

view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,

tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN

tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN

tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON

(tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON

tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1

Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too.

My
query may pull from too many tables or maybe the structure for this

part
is
incorrect. I'm sorry this is so long but I wanted to post enough

information
so that someone could spot what I do not see and get me back on track.

--
Aria W.






  #9  
Old February 3rd, 2009, 06:12 AM posted to microsoft.public.access.gettingstarted
Aria
external usenet poster
 
Posts: 150
Default Why is my form blank?

Tina,
What a difference a day makes along with a "reminder" from a helpful source.
I don't know what I was thinking when I took out EmpID as the ControlSource
and didn't think about column widths *at all*. It seems to be working now. I
think that did it. Thanks for your help.
--
Aria W.


"tina" wrote:

What's happening now is that when I try to enter info into the controls

the
same info is entered into the controls below (this is a continuous form).


then i'd say your controls are *unbound* - that is, blank ControlSource. set
each control's ControlSource to the appropriate fieldname from the form's
RecordSource.
for example: cboCoverageEmployee should have the fieldname CoverageEmpID in
its' *ControlSource* property.

and let's take a look at the *RowSource* for cboCoverageEmployee:

cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

i assume that EmpID is the primary key of tblEmployees, and you've already
said that CoverageEmpID is the corresponding foreign key in tblCoverage. so
EmpID must be included in the RowSource above; go ahead and make it the
first field, because it must be the bound column of the RowSource, and the
BoundColumn property of the combobox is already defaulted to 1 (unless you
changed it). so your RowSource would be

Rowsource = SELECT [tblEmployees].[EmpID], [tblEmployees].[LastName],
[tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

you don't want the user to see the EmpID, so just set the ColumnWidths
property to "hide" the columns the user doesn't need to see. for instance,
let's say the user only needs to see LastName, FirstName. the ColumnWidths
property would be

0"; 1"; 1"; 0"; 0"; 0"

adjust the 1-inch wide columns to whatever width you need to show the
LastName and FirstName values appropriately.

follow the same logic detailed above, to correctly set the ControlSource
property and RowSource property of each combobox control, and the
ColumnWidths property, too.

hth


"Aria" wrote in message
...
Hi Tina,
I figured it was the query once I didn't see my form. I then tried it

using
the form wizard and while I can see the controls, there are still issues
where I need help.

Here is what I have:
Recordsource--tblCoverage

txtCoverageDate

cboAbsentee Employee
Rowsource =SELECT [LastName] & ", " & [FirstName] AS LastFirst,
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [LastName] & ", " &

[FirstName],
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassDescription];


cboTchrPrep (had an error here with both a control source and a rowsource,
corrected)
Rowsource =SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[TeacherPrep] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[TeacherPrep];


cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

cboClassPeriod (had an error here with both a control source and a
rowsource, corrected)
Rowsource = SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[ClassPeriod] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[ClassPeriod];


cboCoverageReasons
Rowsource = SELECT [tblCoverageReasons].[CoverageReason] FROM
tblCoverageReasons ORDER BY [tblCoverageReasons].[CoverageReason];

TxtExplanation--Explanation for cboCoverageReasons if School/District
Business or Work on site.

txtCoverageTime--I want to make this a combo box. While I understand that
you shouldn't store calculated values in your db, our bell schedule has

too
many variables to make it useful.

What's happening now is that when I try to enter info into the controls

the
same info is entered into the controls below (this is a continuous form).
Also when I try to close the form I get the following error message, "You
cannot add or change a record because a related record is required in
tblEmployees".


--
Aria W.


"tina" wrote:

you're making a classic "newbie" mistake. you've inner-joined three

tables
in a query that will be used as the RecordSource for a data entry form.
you've found that a multi-table query is often not updateable, and for

data
entry forms it's also usually not necessary. assuming that the focus of

the
form is to enter records in tblCoverage, just set tblCoverage (or a

query
based *only* on tblCoverage) as the form's RecordSource. you can bind

the
PeriodID field to a combobox control, using tblClassSchedule as the
control's *RowSource* (not ControlSource) - that will give you access to

the
values in the class schedule table. ditto this setup for the

AbsenteeEmpID
field, CoverageEmpID field, and ReasonID field, in each case using the
appropriate related table as the combobox control's RowSource.

hth


"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what else

to
do.
I could really use some help. I'm almost finished creating a my db for

my
school but a situation that has been an issue all along has taken a

turn
for
the worse. My db tracks keys and employee info (personal and school
related).
I now need to track classroom coverage for urgent/emergency situations
(ex.
Teacher A is suddenly ill and needs to leave, who will cover the

class?)
If I
cannot find a volunteer, an administrator will have to force the

issue.
This
info will also be used for payroll because staff sometimes makes side
deals
without informing the office and then sometimes months later, turns in

a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or

Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to form
view,
it was blank. Well, the labels were still there but there weren't any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID, tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,
tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN

tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN

tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON

(tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON

tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND ((tblEmployees.EmployeeType)=1

Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts too.

My
query may pull from too many tables or maybe the structure for this

part
is
incorrect. I'm sorry this is so long but I wanted to post enough
information
so that someone could spot what I do not see and get me back on track.

--
Aria W.






  #10  
Old February 3rd, 2009, 03:07 PM posted to microsoft.public.access.gettingstarted
tina
external usenet poster
 
Posts: 1,997
Default Why is my form blank?

yeah, sometimes just walking away from a problem for a couple hours or even
days makes all the difference. and you're welcome


"Aria" wrote in message
...
Tina,
What a difference a day makes along with a "reminder" from a helpful

source.
I don't know what I was thinking when I took out EmpID as the

ControlSource
and didn't think about column widths *at all*. It seems to be working now.

I
think that did it. Thanks for your help.
--
Aria W.


"tina" wrote:

What's happening now is that when I try to enter info into the

controls
the
same info is entered into the controls below (this is a continuous

form).

then i'd say your controls are *unbound* - that is, blank ControlSource.

set
each control's ControlSource to the appropriate fieldname from the

form's
RecordSource.
for example: cboCoverageEmployee should have the fieldname

CoverageEmpID in
its' *ControlSource* property.

and let's take a look at the *RowSource* for cboCoverageEmployee:

cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName],

[tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees

ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

i assume that EmpID is the primary key of tblEmployees, and you've

already
said that CoverageEmpID is the corresponding foreign key in tblCoverage.

so
EmpID must be included in the RowSource above; go ahead and make it the
first field, because it must be the bound column of the RowSource, and

the
BoundColumn property of the combobox is already defaulted to 1 (unless

you
changed it). so your RowSource would be

Rowsource = SELECT [tblEmployees].[EmpID], [tblEmployees].[LastName],
[tblEmployees].[FirstName],
[tblClassifications].[ClassID], [tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN tblEmployees

ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

you don't want the user to see the EmpID, so just set the ColumnWidths
property to "hide" the columns the user doesn't need to see. for

instance,
let's say the user only needs to see LastName, FirstName. the

ColumnWidths
property would be

0"; 1"; 1"; 0"; 0"; 0"

adjust the 1-inch wide columns to whatever width you need to show the
LastName and FirstName values appropriately.

follow the same logic detailed above, to correctly set the ControlSource
property and RowSource property of each combobox control, and the
ColumnWidths property, too.

hth


"Aria" wrote in message
...
Hi Tina,
I figured it was the query once I didn't see my form. I then tried it

using
the form wizard and while I can see the controls, there are still

issues
where I need help.

Here is what I have:
Recordsource--tblCoverage

txtCoverageDate

cboAbsentee Employee
Rowsource =SELECT [LastName] & ", " & [FirstName] AS LastFirst,
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassID],

[tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN

tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [LastName] & ", " &

[FirstName],
[tblEmployees].[LastName], [tblEmployees].[FirstName],
[tblClassifications].[ClassDescription];


cboTchrPrep (had an error here with both a control source and a

rowsource,
corrected)
Rowsource =SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[TeacherPrep] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[TeacherPrep];


cboCoverage Employee)
Rowsource = SELECT [tblEmployees].[LastName],

[tblEmployees].[FirstName],
[tblClassifications].[ClassID],

[tblClassifications].[ClassDescription],
[tblEmployees].[Active] FROM tblClassifications INNER JOIN

tblEmployees ON
[tblClassifications].[ClassID]=[tblEmployees].[ClassID] WHERE
((([tblClassifications].[ClassDescription])="Certificated" Or
([tblClassifications].[ClassDescription])="Classified" Or
([tblClassifications].[ClassDescription])="Substitute") And
(([tblEmployees].[Active])=True)) ORDER BY [tblEmployees].[LastName],
[tblEmployees].[FirstName], [tblClassifications].[ClassDescription];

cboClassPeriod (had an error here with both a control source and a
rowsource, corrected)
Rowsource = SELECT [tblClassSchedule].[PeriodID],
[tblClassSchedule].[ClassPeriod] FROM tblClassSchedule ORDER BY
[tblClassSchedule].[ClassPeriod];


cboCoverageReasons
Rowsource = SELECT [tblCoverageReasons].[CoverageReason] FROM
tblCoverageReasons ORDER BY [tblCoverageReasons].[CoverageReason];

TxtExplanation--Explanation for cboCoverageReasons if School/District
Business or Work on site.

txtCoverageTime--I want to make this a combo box. While I understand

that
you shouldn't store calculated values in your db, our bell schedule

has
too
many variables to make it useful.

What's happening now is that when I try to enter info into the

controls
the
same info is entered into the controls below (this is a continuous

form).
Also when I try to close the form I get the following error message,

"You
cannot add or change a record because a related record is required in
tblEmployees".


--
Aria W.


"tina" wrote:

you're making a classic "newbie" mistake. you've inner-joined three

tables
in a query that will be used as the RecordSource for a data entry

form.
you've found that a multi-table query is often not updateable, and

for
data
entry forms it's also usually not necessary. assuming that the focus

of
the
form is to enter records in tblCoverage, just set tblCoverage (or a

query
based *only* on tblCoverage) as the form's RecordSource. you can

bind
the
PeriodID field to a combobox control, using tblClassSchedule as the
control's *RowSource* (not ControlSource) - that will give you

access to
the
values in the class schedule table. ditto this setup for the

AbsenteeEmpID
field, CoverageEmpID field, and ReasonID field, in each case using

the
appropriate related table as the combobox control's RowSource.

hth


"Aria" wrote in message
...
Hi,
I don't want to post such a dumb question but I don't know what

else
to
do.
I could really use some help. I'm almost finished creating a my db

for
my
school but a situation that has been an issue all along has taken

a
turn
for
the worse. My db tracks keys and employee info (personal and

school
related).
I now need to track classroom coverage for urgent/emergency

situations
(ex.
Teacher A is suddenly ill and needs to leave, who will cover the

class?)
If I
cannot find a volunteer, an administrator will have to force the

issue.
This
info will also be used for payroll because staff sometimes makes

side
deals
without informing the office and then sometimes months later,

turns in
a
timesheet without enough information.

I added the following tables:

tblClassSchedule
**************
PeriodID
ClassPeriod
TeacherPrep

tblCoverage
***********
PeriodID (FK)*
AbsenteeEmpID (FK to tblEmployees)* *4field PK
CoverageEmpID (FK to tblEmployees)*
CoverageDate *
ReasonID (FK to tblCoverageReasons)
Explanation (if the reason is School/District Business or

Work on
Site)

tblCoverageReasons
*****************
ReasonID (PK)
CoverageReason


I based the form on a query. When I switched from design view to

form
view,
it was blank. Well, the labels were still there but there weren't

any
controls to input information.
SQL:
SELECT tblCoverage.PeriodID, tblCoverage.AbsenteeEmpID,
tblCoverage.CoverageEmpID, tblCoverage.CoverageDate,
tblCoverage.CoverageTime, tblCoverage.Explanation,
tblClassSchedule.ClassPeriod, tblEmployees.EmpID,

tblEmployees.Active,
tblEmployees.FirstName, tblEmployees.LastName,
tblClassSchedule.TeacherPrep,
tblEmployees.EmployeeType, tblClassifications.ClassID,
tblClassifications.ClassDescription, tblTitlesEmps.TitleID,
tblTitles.TitleDescription, tblCoverageReasons.ReasonID,
tblCoverageReasons.CoverageReason
FROM tblTitles INNER JOIN (((tblClassifications INNER JOIN

tblEmployees ON
tblClassifications.ClassID = tblEmployees.ClassID) INNER JOIN
(tblCoverageReasons INNER JOIN (tblClassSchedule INNER JOIN

tblCoverage ON
tblClassSchedule.PeriodID = tblCoverage.PeriodID) ON
tblCoverageReasons.ReasonID = tblCoverage.ReasonID) ON

(tblEmployees.EmpID
=
tblCoverage.CoverageEmpID) AND (tblEmployees.EmpID =
tblCoverage.AbsenteeEmpID)) INNER JOIN tblTitlesEmps ON

tblEmployees.EmpID
=
tblTitlesEmps.EmpID) ON tblTitles.TitleID = tblTitlesEmps.TitleID
WHERE (((tblEmployees.Active)=True) AND

((tblEmployees.EmployeeType)=1
Or
(tblEmployees.EmployeeType)=2) AND
((tblClassifications.ClassDescription)="Certificat ed" Or
(tblClassifications.ClassDescription)="Substitute" ));

I know my form has issues but it has me questioning other parts

too.
My
query may pull from too many tables or maybe the structure for

this
part
is
incorrect. I'm sorry this is so long but I wanted to post enough
information
so that someone could spot what I do not see and get me back on

track.

--
Aria W.








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.