I have the following VB code that reads periodic phone modem transmissions and adds records to an Access Database.
There are approximately 20 records per day.
The operator has an Access datasheet form to view these records.
There is a Refresh button (Me.Form.Requery) on the datasheet form that the operator presses periodically to refresh the form and display any new records that the VB program may have added to the table since the last refresh..
All the above works OK except for the undesired manual form refresh.
Is there a way in the VB program and/or Access DB that I can refresh the Access DB datasheet form after each transmission?
Thanks, John
========================
Sub writerec()
Dim sqltext As String
Dim i As Integer
Dim filename As String
Dim Length As Integer
Dim rst As Recordset
On Error GoTo End_UpdateAccess
'*
'*-- Create Applicable records into access database.
'*
Set dbs = OpenDatabase(dbname)
Set rst = dbs.OpenRecordset("nfalls")
With rst
.AddNew
.Fields!ticket = Trim(ticket)
.Fields!Date = Format(xmitdate, "Short date")
.Fields!time1 = Format(time1, "Short time")
.Fields!oper = oper
.Fields!revticket = revticket
.Fields!email = email
.Fields![Cell Phone] = cellphone
.Fields![Request To] = reqto
.Fields!page = CInt(page)
.Fields![Pager Number] = pager
.Fields![Done By] = doneby
.Fields!completed = False
.Fields!TktTypPriority = TTPriority(tkttype)
DoEvents
.Update
.Close
End With
DoEvents
DisplayLog "U", " " + ticket + " Errors: " + Str(ProcessErrors)
dbs.Close
ResetWorkFields
Exit Sub
End_UpdateAccess:
g = Err.Description
t = Err.Source
e = Err.Number
ProcessErrors = ProcessErrors + 1
'db_error (g)
Resume Next
End Sub



