Refresh for Subform Popup

waka

Registered User.
Local time
Yesterday, 16:09
Joined
Jul 15, 2009
Messages
20
I have a continuous form with with a button that links to another form. The continuous form is based on a query that brings together two tables: tbl_trees and tbl_tree_data. The linked form is linked to tbl_tree_data, but includes two additional subforms: xref_Tree_Conditions, xref_Foliage_Condition. Each of these subforms are based on their respective tables that are linked by a Tree ID. The problem is that when I enter a new record and click on the button, I get an error that says I need a value in Tree ID. If I enter a new record, click on a different old record, and then click the button it works fine. How can I get the form to refresh/save the record so that when I click the button it will recognize that a tree has already been entered? I've tried both putting in a requery method and a save method in the "on click" expression, but neither give the result I want.

Thanks!
 
Try this:
DoCmd.Runcommand acCmdSaveRecord
 
Mstef: I actually tried putting that statement in already. I tried it in the "on click" expression for the button and also in the "lost focus" expression for the continuous form. Neither seemed to work.
 
I had a similar problem. When I was entering data in a form some data wasn't entering into the table. I found that if you enter a new item in a form and click on the button while still in the same cell as the text you've just entered it won't register. You need to tab or click into a different cell, then push the button.
Hope this makes sense
 
SiGill: Yes, this is my problem. Did you find a way to avoid having to click on another cell to get the table to refresh? It's annoying for my users to have to click on another record and then click the button.
 
Is a Macro being run when this button is being pushed?

If you you might be able to add a Save option at the beginning of the macro and ask it to save the table. before running the rest of the macro.
 
No, it doesn't invoke a macro. It just opens up another form.
 
Mstef,

I tried inserting your statement again in my "on click" expression and that worked! Not sure what I did wrong the first time I tried it, but thanks!
 

Users who are viewing this thread

Back
Top Bottom