List Box transaction

F

Frank Dulk

I have a List Box to which I attribute a recordset to the property recordset
of the same because I want to use transactions, until there everything ok.

The problem happens when I update recordset, same giving requery in the list
box, he doesn't exhibit the updated data. Which is the solution for this
case? Only to reaffirm that my intention of " feeding " the list box with
the recordset is so that I can use transactions.

Option Compare Database

Dim wks As DAO.Workspace
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim rsdel As DAO.Recordset


Private Sub Comando11_Click()

' Aquí eliminates the alterations and it shows the data
wks.Rollback
Lista9.Requery
End Sub

Private Sub Comando2_Click()

' Aquí adds the data in the rs

With rs
..AddNew
![tst] = "Dado!!"
..Update
End With

' Aquí should exhibit the data
Lista9.Requery
End Sub

Private Sub Form_Load()

' Here it attributes the rs to the list and it begins the transaction
Set wks = DBEngine.Workspaces(0)
Set db = OpenDatabase(CurrentDb.Name)
Set rs = db.OpenRecordset("SELECT * FROM TstTransTemp;")

Set Lista9.Recordset = rs


wks.BeginTrans

End Sub

A hug,
 
A

Allan Murphy

Frank

You will need to save your record then use the Got Focus of your List box
to Requery.

Allan
 

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