• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 721
  • Last Modified:

ADODB Recordset Requery

I have a couple of list boxes, ex. lstActiveUsers that are based on an adodb recordset. When you double click an item in the list, it loads up a form where you can edit the details of the contents in the list. I want to have the list update when the updatable form is closed, since while editing the details of the list, you could change the user to inactive and therefore shouldn't be in the form anymore.
0
BrucePowerOPs
Asked:
BrucePowerOPs
1 Solution
 
stevbeCommented:
make the reordset variable be public and in the Close event of the update form call prstActiveUsers.Requery.

you could refine it and track in the updatebale form to see if anythign has been added/deleted, if not then a refresh should do the trick and be faster.

Steve
0
 
BrucePowerOPsAuthor Commented:
That doesn't work. It gives me an error: Operation not allowed when the object is closed. I think it's because I have the settings:

rst.CursorType = adOpenStatic
rst.LockType = adLockReadOnly
rst.CursorLocation = adUseClient
Set rst.ActiveConnection = Nothing

Any other ideas?

I guess I I could just set the recordset again to a recordset with the same sql statement...
0
 
fanopoeCommented:
try these settings:
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
BrucePowerOPsAuthor Commented:
That might work however I don't want those settings.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You're closing the connection for the recorset, therefore you cannot refresh or requery. YOu would have to reset the connection, then requery:

Set rst.ActiveConnection = <some connection object>

then requery
0
 
BrucePowerOPsAuthor Commented:
Ya that's what I had thought. I guess I'll just reset the connection upon returning to the form.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now