refresh form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's the procedure for refreshing a form on closing it

What's the procedure for refreshing a form on clicking on a button that
opens a report based on the current student on the form?
 
What's the procedure for refreshing a form on closing it
Why on earth do you want to refresh a form on closing it?? If it is closing,
who worries about what is on it.
What's the procedure for refreshing a form on clicking on a button that
opens a report based on the current student on the form?
Me.Refresh 'for the form

or if you actually mean the underlying data

Me.Requery

HTH
Marc
 
I have a form that has client information and then to view additional client
info you can click on a button to take you to a little form with this info.
But the main form remains open and some of the fields in the main form and
the little form are the same. So if i edit the name field say in the main
form when i open the little form i want this to be updated.

Just thinking maybe when opening the little form i should run a macro that
closes the big form and then opens it again on closing the small form - would
that be better?

If yes, then how do i do it? Because the small form i only want that guys
additional info to be in the form but when it goes back to the big form i
wnat it to be on that guy but still all the other clients info should still
be there!

I don't know may be the first way is better.
 
I have a form that has client information and then to view additional
client
info you can click on a button to take you to a little form with this
info.
But the main form remains open and some of the fields in the main form and
the little form are the same. So if i edit the name field say in the main
form when i open the little form i want this to be updated.
ok, that sounds more logical.
In the close event in the VBA code you add a line:
Forms![name of main form].Requery

And that shows the latest information

Marc
 
That does refresh the form but the main form is then on the first client in
the form. I still want to be on the main form of that particular client whom
i was busy with his additional info form!

Marc said:
I have a form that has client information and then to view additional
client
info you can click on a button to take you to a little form with this
info.
But the main form remains open and some of the fields in the main form and
the little form are the same. So if i edit the name field say in the main
form when i open the little form i want this to be updated.
ok, that sounds more logical.
In the close event in the VBA code you add a line:
Forms![name of main form].Requery

And that shows the latest information

Marc
 
That does refresh the form but the main form is then on the first client
in
the form. I still want to be on the main form of that particular client
whom
i was busy with his additional info form!

You would then need to add something like the following:

lngID = <id field of table, eg CustomerId>
Forms![name of main form].Requery

Set rst = Forms![name of main form].RecordsetClone

rst.FindFirst "[<id field of table>] = " & lngID

If Not rst.NoMatch Then
Forms![name of main form].Bookmark = rst.Bookmark
End If

rst.Close

Set rst = Nothing


Marc
 
Back
Top