Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic problem with subform data entry 1

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
I'm having trouble figuring out how to set this up. As a test, I have 2 very basic tables. They look like this:

BOX
Box Number Autonumber Primary
Box Name Text

FILE
File Number Autonumber Primary Key
File Name Text
Box Key Number

These tables are linked by box key.

I made a form that displays box. I inserted a subform to display file, linking the two by box key. I want to use this form to enter files, where they are linked to the box currently displayed in the main form. When I open this form, I cannot enter new records for the files. I am hoping to understand why this is...and how I ought to be setting this up to achieve this functionality. BTW, the subform is set to yes for data entry, allow additions etc.

TIA


Holly
 
I would like to use this form only to enter new records in my file table. But I would like them to automatically have the box key of the box showing in the main form.
 
Well, you say "linking the two by box key," but your post shows no box key Field in the Box Table! Is Box Key actually linked to the Box Number Field in the Box Table?

What is the Record Source for the Form your Subform is based on, a Table or a Query, and if Query, does it contain one Table or multiple Tables?

If you open the Subform independent of the Main Form, can you enter New Records?

The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
How are ya hpl2001 . . .
[blue]I would like them to automatically have the box key of the box showing in the main form.[/blue]
This should already be happening if the link master/child fields are set properly. Since you say its not happening it looks like missinglinq is correct.

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Ok, bit of a typo up top. There is a field called Box Key Number in both tables. This field links the form and the sub form. In this test I based the main form on the table BOX, and the subform on the table FILE. I was trying to keep things as simple as possible so I could see where I was messing up. The FILE based form on it's own will not let me enter a new record. When I run the form/subform combo, I see the box data file, but where my subform should be is basically a blank box. Shouldn't this be a very straight forward thing? I just want an entry form for my FILES table that will automatically link to a pre-selected box.
 
Does your main form display a "pre-selected box"?
What do you mean by "will not let me enter a new record"? Do you get an error message? Are there controls to enter anything?
What do you mean by "blank box"? Do you see any controls?

Duane
Hook'D on Access
MS Access MVP
 
The main form displays a box - that's the one I want to link my files to. If I set data entry for my sub form to no, then I can scroll through my files records, but I cannot add or change anything. If I set data entry to yes, the subform disappears. I see the mavigation controls, but the rest of the sub-form area is blank. Similarly, if I set my main form data entry to yes, it disappears too. But I don't even want to scroll my existing file data. I just want to enter a new file record and be able to save it.
 
To add insult to injury, I'm having to do this in access 2003
 
I like Access 2003. Use Data Entry if you only want to see new records, not existing. If you don't see a place to enter new records, this suggests some form data property that is incorrect or the form's record source is read-only.

Duane
Hook'D on Access
MS Access MVP
 
Seeing only new records was exactly what I wanted. Fiddled with combos of data properties and I finally got it. Thanks!! Now I can give my forehead a rest from banging on my desk....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top