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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing Sub Forms???

Status
Not open for further replies.

Janet95

Technical User
Jun 6, 2006
45
US
Hi,

I ran into this problem a long time ago, however I cannot remmeber the solution [sad]

I have a form with mulitpule pages with subforms in each page. For some reason all of a sudden some of the subforms dissappear. If a record doesn't exist or if I go to add a new record the subform displays a blank form with no fields / labels. This happens if the subforms record ID is blank or null.

Is there a property setting I have incorrectly set?

On the "ON OPEN" event of the main form, I have it set to "Allow Edits" = False for the sub forms.

Also on the subforms I have "Allow Additions" = True.

The above has alway been there without any problems.

The problem seems to have arose when I added code to remove a subform record from the main form by place a remove command button that says txtID = ""

This clears the relationship between the to forms. Which worked the other day when I was testing the entire database.

Now this new issue has appeared.

Any help would be greatly appreciated.

Thanks in advance
Janet [peace]


Thanks
Janet [ponytails2]
 
Janet,

I'm a little confused. Can you be more specific as to what is deleting what? IE, what are the links and what is deleted with txtID =
 
Hi, I just have a parent record with a child record attached to it with a primary key. So, the main recored has a column named childID. If I remove the value from the parent record with txtID = "", then the child record will be disacosciated from it.

In other words I have a main form with a subform, I want to remove the subform / record, but not permanately (not from the back end).

Not sure if this makes it clear.


Thanks
Janet [ponytails2]
 
You mean you just want to suppress the record visually? If that's the case, I would think you need to add some more criteria to the query that the subform is based on and requery the subform after a user action. Then the record would no longer appear in the subform.

Is this what you're trying to do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top