D
DZ
Hi
I want to refresh the data in a form programatically.
I have a main form where the user can update a value in the form's
underlying data by double clicking a control on the form. Doubleclicking
opens another form that allow him to update the value. The reason why there
is a separate form just for updating rather than doing it in the main form is
that the underlying data is a query that join two tables and the value I want
the user to update is not updatable in the query.
So the update form's underlying data is one of the table's in the query
with joins.
In this table I am able to change values.
Now after the user makes the change in the update form and then closes it, I
want the change to appear immediately in the main form. And I want the main
form to update automatically without using a button so that its simpler for
the user. i noticed that if I execute Remove filter Sort from the Records
menu while the main form is active, the changes update. But I can't seem to
do this programmatically.
I tried to perform this update programatically unsuccessfully by doing the
following. none of these worked
From the main form
Private Sub Form_Activate()
DoCmd.RunCommand acCmdRemoveFilterSort
Me.Refresh
Me.Requery
End Sub
From the update form
Private Sub Form_Unload(Cancel As Integer)
Forms("Employee Hours").Controls("Projected Hours") = Me.Projected_Hours
End Sub
'This tries to simply transfer the value from a control in the update form
to a control in the main form....I get an error "The recordset Is not
updateble". That makes sense, but i wanted to try it anyway
please help me refresh the data in the main form
Thanks for any help... I always credit any help I get
I want to refresh the data in a form programatically.
I have a main form where the user can update a value in the form's
underlying data by double clicking a control on the form. Doubleclicking
opens another form that allow him to update the value. The reason why there
is a separate form just for updating rather than doing it in the main form is
that the underlying data is a query that join two tables and the value I want
the user to update is not updatable in the query.
So the update form's underlying data is one of the table's in the query
with joins.
In this table I am able to change values.
Now after the user makes the change in the update form and then closes it, I
want the change to appear immediately in the main form. And I want the main
form to update automatically without using a button so that its simpler for
the user. i noticed that if I execute Remove filter Sort from the Records
menu while the main form is active, the changes update. But I can't seem to
do this programmatically.
I tried to perform this update programatically unsuccessfully by doing the
following. none of these worked
From the main form
Private Sub Form_Activate()
DoCmd.RunCommand acCmdRemoveFilterSort
Me.Refresh
Me.Requery
End Sub
From the update form
Private Sub Form_Unload(Cancel As Integer)
Forms("Employee Hours").Controls("Projected Hours") = Me.Projected_Hours
End Sub
'This tries to simply transfer the value from a control in the update form
to a control in the main form....I get an error "The recordset Is not
updateble". That makes sense, but i wanted to try it anyway
please help me refresh the data in the main form
Thanks for any help... I always credit any help I get