How to requery main form before opening subform.
Everything works fine with existing records, but when I click a button on the main form, to open up the subform, the Name field in the subform is blank, unlike that of the main form, which has just been filled in. Both forms are linked to the same 'name' field in an underlying table.
So I suspect, filling in the 'name' field in the main form, only updates the underlying table upon closing the main form (or changing the record?). What I want it to do is to update the main table as soon as the name text box has been filled in, in the main form. I hope this is clear
Thank you for taking the time to report an issue.
What's wrong... Please write below.
This would not be a problem, but the user can enter time for previous days, and therefore the requery moves the previous days records to the chronological order.
The short, is on an AfterUpdate event on the subform, how can I requery just the text box on the main form?
I am trying to requery a combo in subform (cmbEquipDetails) based on a selection in the main forms combo box
I thought this code should work however it is not
in afterupdate of first combo
Forms!frmInspections!frmEquipment.Form![cmbEquipDetails].Requery = True
To do this I am using the "requery" command in the "on change" event property of the main form's date field. When I open the forms, the defaults all work, but when I change the date on the main form, the subform requeries to show the data that is in it's table, Is there a better option than requery?
When I run the Loan Search query with Search populated, it filters and works correctly. When I try to have it requery automatically, it doesn't seem to.
I have tried every combination of
Forms![Navigation]![Loan Search Subform].Requery
Me![Loan Search subform].Form.Requery
that I can think of. Some throw error messages. but no requery occurs.
I want to update one subform from another but am having no joy. I cannot requery the second subform. ive read alot of threads about requery, referencing the main form and then subform2, the subform control name v's form name etc but still no joy.
Subform1 sets up the data displayed in subform2 - so depending on subfrom1 some fields in subform2 could be hidden or placed in a particular position on the form. I have this visible/not visible code in the onload event of subform2. This works well if the main form is closed after subform1 is updated. When I reopen the main form subform2 is displayed correctly.
I know the subforms are already "loaded" when the main form is opened but how can I get subform2 to reload when subform1 is updated. Should I have my formatting code of subform2 in a differnt event than onload? Is requery the correct command to use? when i want to esentially reload subform2.
When checked, if the related record is not complete, the user has the option to either edit or delete the incomplete related record.
If the record is deleted, then the subform is requeried to show the updated records (rather than the #Deleted entry).
All of that works as it should. BUT! There is a label in the header of the subform that displays a count of the records in the subform. It is updated OnLoad , OnQuery, OnCurrent and OnDataSetChange.
However, when I requery the subform using Forms!frmMain.frmSub.Form.Requery the label is not updated.
Should any of the above events be triggered by the .Requery Method?
but it doesn't show the latest data. If I close the main form and reopen the Actions are correct so I know the data is changing correctly
when the main form first opens is well - the subform is blank; after the user populates some info into the subform - then I need to press a button on the main form and "refresh" the subform to a blank slate.
gotonew record just moves the record selector to the bottom new record - leaving the existing data showing.
other than closing the main form manually - and reopening - - I don't see a way to reset this subform.
I need to prevent the user from opening up the sub form manually by pressing this button on the main form. I only want the sub form to pop up automatically when the criteria is met in the fields of my main form.
What do I need to do to this button so that it can only be used for closing the sub form, and cannot be used for opening it manually?