If anyone could help me with an IF statement.

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

Guest

Hello,

I added a me.refresh to an On Timer expression for a subform, and I'm having
some problems. When the subform refreshes and I'm working in a record the
beforeupdate expressions on the main form run.

Is there a way I could have an if statement that runs in On Timer event that
only refresh if you are not in a record.

I was playing with this, but it did not work

If me.recordset Is null Then
me.refresh
else

End if
End Sub

I'm sure I'm on the wrong track with the code, so any help would be great

Thank you
David
 
Hmm. I've never used a timer in a subform - principally because I've never
needed to. I'd suspect that you're attempting to use it to do something
that is better done in a different way. What exactly are you trying to
achieve?
 
Hello,
The database is for students to sign in on when they come to our office.
When a student signs in their info appears in a small subform. Currently
this iformation is updated when a command button is pressed to update the
form. My goal is to have this update automatically. I put a me.refresh in
the On timer event for tyhe subform. This works, but it also fires the
before update expressions before I'm done filling out the rest of the form.
So, I have been researching this and came up with

If Forms!StuListSbfm.dirty = false then
me.refresh


but it did not work.

Thank you for your help so far.

Dave
 
They're entering their name into a text box on the main form? At worst, you
will be able to do something with the after update event of that text box.
How do you have the subform linked to the main form? Is the main form bound
to a table or query?
 
Back
Top