how to show last record

B

boris

table record counts updates only if i switch between design and open.
It does the same to the form.
Please, help to upgrade every time new record is addeded

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim xlApp As Excel.Application
Dim xlWbk As Excel.Workbook
Dim xlSht As Excel.Worksheet
Set xlWbk = Excel.Workbooks.Open("C:\Documents and Settings\Boris\My
Documents\results.xls", ReadOnly:=True)
Set xlSht = xlWbk.Worksheets("results")
Set db = CurrentDb
Set rs = db.OpenRecordset("results")


With rs

.AddNew

.Fields(0) = xlSht.Range("A2")
.Fields(1) = xlSht.Range("B2")
.Update

.Close

End With



Set xlSht = Nothing
Set xlWbk = Nothing
Set xlApp = Nothing

Set rs = Nothing
Set db = Nothing

Else
 

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

Top