Problem with Subform control not working properly

H

Horselover

I have a subform that will not be used with every record; it is a follow up
form. If a customer has an issue that needs followed up on, then the end user
will click the button, the subform will open, and they will enter the
appropriate information.

I'm having several problems with this subform. First, I want it linked by
the Customer Number (primary keys for both forms) to my main form, so when
you open the Follow Up form, it already has the Customer Number in that
field. I cannot seem to get it to do that - it will allow me to enter that
number in there, but it will also allow me to put the incorrect Customer
Number in there, which assigns the follow up item I enter to the incorrect
person - just tried it. Not good!

Second when I open the form and a Customer has not had a follow up yet, I
want it to be a blank form. How do I get it to do that? It also says it's
filtering the form, if that helps......

Thank you for any help you can give me.... :)
 
K

KARL DEWEY

First, I want it linked by the Customer Number (primary keys for both
forms) to my main form, so when you open the Follow Up form, it already has
the Customer Number in that field.
Forms do not have primary keys. Tables have primary keys. You need to use
a query for the subform source that include the primary key of the table that
is the one side of a one-to-many relationship.
Like this --
Employee table EmpID as primary (unique) --
EmpID LName FName etc
A001 Jones Bill ...
C004 Brown Joe ...

Time_Card table with EmpID as foreign key --
EmpID WrkDate Hrs Type
A001 1/1/2007 8 Reg
A001 1/2/2007 4 Vac
A001 1/2/2007 4 Reg
A001 1/3/2007 8 Reg
C004 1/1/2007 8 Reg
C004 1/2/2007 8 Reg
C004 1/2/2007 1 OT
C004 1/3/2007 8 Reg

The form/subform are link Master/Child on the EmpID fields.
 
H

Horselover

Thanks, appreciate your help!

KARL DEWEY said:
forms) to my main form, so when you open the Follow Up form, it already has
the Customer Number in that field.
Forms do not have primary keys. Tables have primary keys. You need to use
a query for the subform source that include the primary key of the table that
is the one side of a one-to-many relationship.
Like this --
Employee table EmpID as primary (unique) --
EmpID LName FName etc
A001 Jones Bill ...
C004 Brown Joe ...

Time_Card table with EmpID as foreign key --
EmpID WrkDate Hrs Type
A001 1/1/2007 8 Reg
A001 1/2/2007 4 Vac
A001 1/2/2007 4 Reg
A001 1/3/2007 8 Reg
C004 1/1/2007 8 Reg
C004 1/2/2007 8 Reg
C004 1/2/2007 1 OT
C004 1/3/2007 8 Reg

The form/subform are link Master/Child on the EmpID fields.
 
Top