Update Open Form

G

Gee

I have a form that is always open because it needs to run a timer to send
emails after a call has been open for a certain amount of time,
TimerForm...it times NOC calls.

That form is run by a query which is attached to a table that ALL the forms
are attached to.

What I need is that when a record is changed in the SvcForm, it needs to
update on the TimerForm that is open always.

How do I update an open form? I've been trying to get this solved and am
starting to get disparate.

Thank you in advance for any help you can give me.

This is my code for the TimerForm:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime

If CallDate > 0 Then
NOC = DateDiff("s", TimeValue(CallDate), TimeValue(txtCurrentTime))
End If

If NOC = "400" Then
DoCmd.SendObject acSendReport, "NOCR", acFormatSNP, Me.Text39, , , "NOC
AGING", Me.CallNo, False
End If

If NOC = "2700" Then
DoCmd.SendObject acSendReport, "NOCR", acFormatSNP, Me.Text39, , , "NOC
AGING", Me.CallNo, False
End If

If CallDate > 0 Then
DoCmd.GoToRecord , , acNext
Else: DoCmd.GoToRecord , , acFirst
End If

End Sub
 
P

Piet Linden

What I need is that when a record is changed in the SvcForm, it needs
to
update on the TimerForm that is open always.

How do I update an open form? I've been trying to get this solved and
am
starting to get disparate.

Getting disparate? Is that a form of schizophrenia?

First off, Forms don't contain data - they just display it. The data
is in a *TABLE*. so if you force the data to be saved to the table,
and then refresh the form that is based on the table, the records
should "update" (show any updates) there too. You can just put some
code in the AfterUpdate event of the SvcForm and set a value in the
TimerForm, (since it's always open, it should be easy).

In SvcForm
Private Sub Me.AfterUpdate()
Forms!TimerForm!SomeControl = Now()
End Sub
 
G

Gee

LOL! I KNEW I spelled desperate wrong! Schizophrenia..,funny...but this
kind of thing CAN drive you mad.

I'll try the AfterUpdate thing, it sounds like it might be on the right
track, but the form is always open on one machine, not all of them...there
about 20...front ends shared with a split database.

Oh, and I knew that about the "Table" thing, I built the database...I just
don't understand why a form wouldn't update if it was open.

I'll try it and if it doesn't work I'd really appreciate your input.

Thanks!
 
G

Gee

It did not work.
It said there was a conflict with an open form and froze them both.
Another thing, this form is open on only one computer.
Any other ideas? My customer is getting anxious.
Thanks,
Greta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top