Forms and Subforms

Indigobuni

Registered User.
Local time
Today, 13:10
Joined
Oct 9, 2001
Messages
26
I have two tables: TABLE A( name, week begin, week end, company) and TABLE B(name, date, expense, description, amount). I have tried to create a form/subform, but am having trouble. Form (table A), Subform (table B). I'm trying to create a one-to-many expense report where the person types in their info (table A), then tabs down and enters their expense reporting stuff (table B).

1. Do I need to use a macro to get the persons name from the form to appear in the subform when it is typed in the form? If yes, how. If no, how.

2. I tried to create the form/subform and typed in the info. When I tabbed to the subform and tried to type in the info there, it said the property was read-only and can't be set. I've never encountered a read-only before. What did I do wrong?

My tables are simple. I created a join relationship based on the name being the same, but maybe that was wrong? Can anyone help me? Thanks.
 
Has your Person table got a Unique primary key, Say PersonID which is an Autonumber? Has your Expense table got a foreign key also called PersonID which is a Long Integer? Are these two fields joined in the relationships window in a one-to-many relationship with referential integrity enforced?

If not, do that now and post back with any problems.

Just worth enquiring:

Why do you want the person's name in the subform when it's already on the main form?
 
That helped a lot

Thanks so much! That helped a lot and I was able to finish my forms, queries and reports in less than an hour.

As for the name in both places, it wasn't necessary to have it that way, I was just trying to find something in common to make them relate to one another. I got rid of it. One problem could have been that I didn't even have a primary key. Most tables and stuff that I do are simple and don't require one. Thanks :)
 

Users who are viewing this thread

Back
Top Bottom