Form Reloading

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

Guest

Hello,

I have a form that’s has an event “On Loadâ€. Using code how can I get the
form to reload from itself?
I thought
“DoCmd.OpenForm "fmOrdEnt", acNormal, "", "", , acNormalâ€
Would work, but I guess it can’t open something already open.
I also tried
“fmOrdEnt.requery
This doesn’t work either.

That’s for any help!
 
What are you trying to accomplish with this? The requery should force the
form to reread the data source as if the form had just opened. For the
requery, try the syntax

Me.Requery

if you are running the code from within the form. If you are running the
code from elsewhere, try

Forms!fmOrdEnt.Requery
 
For what you are trying to do, you will need to set the visible property of
the controls. Use the Option's AfterUpdate to turn them on and either the
submit button's Click event or the form's Current event to hide them again.
To check for a new record in the Current event you would use

If Me.NewRecord Then
'Hide them here
Else
'Unhide them here
End If

Using the Else will make them visible if you're wanting to edit an old
record.
 
Back
Top