Subform not showing up???

  • Thread starter Thread starter duchessofireland
  • Start date Start date
D

duchessofireland

In design view I can see my subform - when I try to view it the other way it
is not there? Any ideas why?
 
In design view I can see my subform - when I try to view it the other way it
is not there? Any ideas why?

This can happen when both of two conditions are true: the subform is based on
a query that is not updateable, so you can't see the new record; and it's a
query which returns no records, so you can't see any existing records either.

What's the Recordsource property of the subform? If it's a query, and you open
it in datasheet view, do you get any records - and do you get the *> blank
line at the bottom? I'd guess the answer is no to both.

If you'll post the SQL view of the query and explain what the subform is
intended to show, someone may be able to help.

John W. Vinson [MVP]
 
My subform is actually based on a table. I'm trying to add a subform to a
job order form so that I can go through and add employees to a job one at a
time (kind of like adding purchased items to a receipt). Any help you can
give would be great! I'm really new at this and don't understand a lot of
"technical language". Thanks!
 
My subform is actually based on a table. I'm trying to add a subform to a
job order form so that I can go through and add employees to a job one at a
time (kind of like adding purchased items to a receipt). Any help you can
give would be great! I'm really new at this and don't understand a lot of
"technical language". Thanks!

What Tables do you have in your application? Please post table names and
indicate what kind of information the table contains, and identify the Primary
Key field.

What's the Recordsource property of your form? Open the form in design view,
view its Properties with the View menu option, and post what is in the
Recordsource property (first on the data tab). If it's a query, open the query
in design view, select View... SQL, and post the SQL text here.

Do the same for the Subform.

Also post the Master Link Field and Child Link Field properties of the Subform
control.

My guess is that you've based the subform on a query, but without more
information I can't even be sure of that!

John W. Vinson [MVP]
 
tblConstruction - Primary key is autonumber - information is location, job
type and dates

tblEmployees - Primary Key is autonumber - information is first name and
last name

tblAssignments - Primary Key is autonumber - 2 fields (autonumber from
employees and autonumber from construction)

Record source of the main form is Construction

Record source of the subform is Employees

LinkChildFields and LinkMasterFields are both ConstructionID

Thanks for your help
 
tblConstruction - Primary key is autonumber - information is location, job
type and dates

tblEmployees - Primary Key is autonumber - information is first name and
last name

tblAssignments - Primary Key is autonumber - 2 fields (autonumber from
employees and autonumber from construction)

As Long Integers, not autonumbers, right?
Record source of the main form is Construction

Record source of the subform is Employees

THAT'S your problem. The recordsource for the subform should not be - cannot
be! - employees; it should be tblAssignments.
LinkChildFields and LinkMasterFields are both ConstructionID

tblAssignments has a ConstructionID field. tblEmployees doesn't. Typically you
would put a Combo Box on the subform, bound to tblAssignments.EmployeeID,
using a query based on tblEmployees as its Row Source query. This will let you
pick as many employees as needed for assignment to a job. You can use the
combo box's Not In List event to open a data-entry form for new employees if
needed, but as a rule you would want your employee table already filled.

John W. Vinson [MVP]
 
Okay...pretty much got that figured out... Now my problem is...I can select
my employees for the job. When I go to the next empty record - the employees
that I previously selected on the record before are already showing in the
next empty record. Ugh! Hopefully you can help. Thanks
 
Okay...pretty much got that figured out... Now my problem is...I can select
my employees for the job. When I go to the next empty record - the employees
that I previously selected on the record before are already showing in the
next empty record. Ugh! Hopefully you can help. Thanks

You can see your form. I can't. I really don't have any idea what you mean.

What is the Recordsource (now) of the mainform? Of the subform? Please post
the SQL or the key fields of the table. What are the subform's Master and
Child Link Fields? What kind of control is displaying the employees? If it's a
combo, what is its Rowsource (SQL again)?

John W. Vinson [MVP]
 
Okay...record source for the main form is tblConstruction. for subform -
tblAssignments. Link Child and Link Master are Construction ID. The control
showing the employees is a combo box - Row source is =

SELECT EmployeeID AS Expr1, FirstName & " " & LastName AS FullName
FROM tblEmployees
ORDER BY tblEmployees.LastName, tblEmployees.FirstName;

Thanks for your help.
 
Okay...record source for the main form is tblConstruction. for subform -
tblAssignments. Link Child and Link Master are Construction ID. The control
showing the employees is a combo box - Row source is =

SELECT EmployeeID AS Expr1, FirstName & " " & LastName AS FullName
FROM tblEmployees
ORDER BY tblEmployees.LastName, tblEmployees.FirstName;

That all would appear to be in order. What's the Control Source of the combo?
The Bound Column? Is an employee name showing up in the combo box on the
subform, in the blank row at the bottom? What's that control's DefaultValue
property? Do you have any VBA code in the form?

John W. Vinson [MVP]
 
Control Source of Combo Box is EmployeeID. Bound Column is 1. No there is
not an employee name showing up in the combo box on the subform, in the blank
row at the bottom. (((Not really sure what you are asking on this one)))
Every time I choose an employee from the drop down list, it creates another
blank row underneath of it. There is no Default Value. VBA code....I don't
know anything about that ....I assume the answer would be no.
 
Control Source of Combo Box is EmployeeID. Bound Column is 1. No there is
not an employee name showing up in the combo box on the subform, in the blank
row at the bottom. (((Not really sure what you are asking on this one)))
Every time I choose an employee from the drop down list, it creates another
blank row underneath of it. There is no Default Value. VBA code....I don't
know anything about that ....I assume the answer would be no.

OK... so what do you mean by

Now my problem is...I can select
my employees for the job. When I go to the next empty record - the employees
that I previously selected on the record before are already showing in the
next empty record. Ugh! Hopefully you can help. Thanks

Showing in "the next empty record"... where? In the Subform?

John W. Vinson [MVP]
 
Back
Top