If the subform is bound to the table (its record source), then it should update automatically.
If the subform is bound to the table (its record source), then it should update automatically.
pbaldy, Yes the record source is bound to the table.
Then it should update when you change records on the subform, change focus from the subform to the main form, or close the form. Does it not? Can you attach the db here?
I have a button that saves that record and a button to start a new record.
I tried those and it did not update.
Here is the db:
ProcessSheets 5-1-17.zip
That's a PDF.
OH my.
I may see the problem.
I have the save button and new button on the main form and not the sub form.
Will that make a difference?
sorry, picked the wrong file
Yes, the buttons are on the main form so they aren't saving the subform record, though it should save anyway when focus leaves the subform to the button. The new button would affect the main form, not the subform.
I tried a save button on the sub form but it did not save the numbers to the table.
I must have something out of wack.
Save what numbers? In the version you posted, new records in the subform are saving to the table.
The Operation_Numbers are not being saved.
When I completed the form for the auto fill it did not save those operation numbers to the table.
Because that textbox isn't bound to a field in the table, it just has an expression to display:
=[Operation_ID].[Column](1)
So this is the code I put in the AfterUpdate event
Option Compare Database
Private Sub Operation_Number_AfterUpdate()
Me.Operation_Number = Me.Operation_ID.Column(1)
End Sub
Private Sub Operation_Number_BeforeUpdate(Cancel As Integer)
End Sub
But that kind of defeats the purpose of the auto fill, no?
I will have to input the Operation_Numbers by hand and then it will save them.
No, the code would go behind the ID combo, so when they make a selection there it populates the other.