New records are not updated on form

Chocolatte

chocolatte
Local time
Today, 15:34
Joined
Jun 15, 2004
Messages
6
I haven't been able to find a posting that lists the problem I'm having, so I'm hoping someone has some suggestions to offer.
Background:
I have a subform AddObs (child) that is linked to the main form AddNest(parent) by the NestTreeID field. I have it so that when someone fills in information for a nest tree on the main form, they can click on the toggle button (I got the toggle button using the form wizard) and enter observation information on the subform. When the subform opens, the NestTreeID from the main form is automatically entered in the NestTreeID field on the subform.
:confused: Problem:
My problem occurs when someone enters information in the main form, but decides not to enter information in the subform. When they close out of the form and/or database and then try to go back to the form to navigate through all of the nest records on the main form, the record(s) they just added does not show up on the form. However, the nest information is added to the nest information table. There is no problem if the user adds information on the main form AND subform.
Is there a way to update the form to reflect the new records or do I need to force the user to enter info on the subform using a message box?

Thanks!
 
Do you have the form bound to a querry.
If so the relaship between the two there could be prventing you to see the record becuse there is no record in the other table. This is assuming that you have two diffrrent tables.
You may have to edit the relationship.

I would also think about haveing a form for data entry and and a form for updating records.
 
Last edited:
The form is bound to a query which consists of the nest information table and observation table. Any thoughts on what I should look for when editing the relationship table? As it stands now, many observations can be entered for 1 nest.

Thanks.
 
1. When you have a button on frmA that opens frmB to add related records, you MUST save the current record first. So, immediately prior to the OpenForm method, add:
DoCmd.RunCommand acCmdSaveRecord
2. In frmB, use the BeforeInsert event to populate the foreign key rather than the Open event or some other method. This will keep you from dirtying the form and causing a problem if the user simply decides to cancel out of the form without completing it.
 
First of all check to see if the records are showing in the querry.
I doubt they are

In querry design mode
that line that connects the tables together right click the line and check join properties

you will have to select the show all records from nest and only those equall from obsevations.

see if this works for you.
 
Pat & Exodus,
Thanks for your suggestions.
I have made the suggested changes, but I still can't get the added records to show up on the forms.
I changed the join properties on the query which contains the nest table and observation table and the added records still don't show up in the query.
Is there anything I can post (i.e. screenshot, code, etc.) that might help in finding a solution?

Thanks
 
My DB is 25mb, so I've sent a greatly reduced version. This basically has the forms, tables, and queries associated with the main form and subform.
If you try to add nest info. in the nest form and exit the form without entering observation info., then the added nest will not show up when you
go back to the form and try to scroll through the forms.
Hopefully, I haven't left anything out. I tried to reproduce my relationship diagram, but for some reason it won't let me enfore referential integrity. Anyways, the two tables are linked via the NestTreeID field in a 1-many relationship.

Thanks
 

Attachments

Chocolatte,

I've been working with it a bit but with the missing Search form and and other missing forms it's hard to isolate the problem. However in the querry
for the parameters I took them out and it shows all the records but without the search form I don't know if thats the problem or not. Also for enforcing the integrity there was a record in the obs table that wasn't in the Nest table.
 
Ok I narrowed it down If there is no Quad assigned then it won't show.
this is because of the Parameter for the quad in the querry.

As long as you have a quad assigned no problems.
 
:) Thanks Exodus!
I see what you're saying about the Quad field needing information. It's the answer I've been searching for! Thanks for getting to the bottom of this for me.
 

Users who are viewing this thread

Back
Top Bottom