Topics Search

Refresh open Recordset

Refresh open Recordset
Views: 24
I have this ode:

set RsItems = db.openrecordset("Items" RsItems.Addnew RsItems!Quantity = RsItems!quantity + 10 Rs!Items.update Me!Total = RsItems!Quantity RsItems.close

The displayed Value in (total ) is an old value not after adding 10
the problem is the table Items not refreshed
how can I refresh the table before displaying Quantity in (total
Sponsored Links:

More topics

 

Recordset get records from Recordset

Preview
trying to open a recordset from a select statement off of another recordset. access can't find the input table or query.

Is it not possible to open a recordset off the results of a prior opened recordset
 

How to refresh table data between closing and opening form

Preview
I have a function that adds a new record to the backend when clicked on a button. The function is in a module but is originally called by a button on the form I am using.

When I use rs.add in the code and then close and open the form by code it does not show the new record on the form. But if I manually close the form and open it again manually it now appears.

I also checked the table as well and it does the same thing as the form. If I have the form open and I use my function to close and open it. while adding a new record the table still shows no new record but as soon as I manually close the form the table shows the new data.

I thought this would be a simple .requery or refresh I even tried db.recordset.refresh and db.tabledefs.refresh but no luck
 

Requery vs. Refresh

Preview
What exactly is the difference between Form.Requery and Form.Refresh? I know that Form.Requery is the command to run the recordset query again, but Form.Refresh appears to do the same on my form. The only difference I've noticed is that Form.Requery brings the focus back to the top record, but Form.Refresh stays on the current record. Any insight
 

Using the Recordset with MS Access and ADO

Preview
A Connection object may give you access to the database, but that's only half the equation; the Recordset object gives you access to the data. Keep reading to learn more about the Recordset. TOC: Using the Recordset with MS Access and ADO; The Recordset Object, Properties, Methods and events; Write code to Open ADODB connection, Recordset and close open objects; Review recordset properties using code.
 

Requery vs. Refresh

Preview
What exactly is the difference between Form.Requery and Form.Refresh? I know that Form.Requery is the command to run the recordset query again, but Form.Refresh appears to do the same on my form.

The only difference I've noticed is that Form.Requery brings the focus back to the top record, but Form.Refresh stays on the current record.
 

Recordset dilemma

Preview
I'm having a problem dealing with a recordset closing. The problem occurs when I got an error message.
"Operation is not allowed when the object is open."
So I get the bright idea to test if the recordset (rs) is open as in
if rs.state = 1 then
rs.close
end if
But, when it executes this line I get an error "Operation is not allowed in this context".
Seems like I'm dammed if I do and dammed if I don't. Is there some other way to handle the recordset state?
I have the recordset defined in a module as in:
Dim rs As New ADODB.Recordset
I assumed that once declared all I would have to do is open and close the recordset. Can someone explain the error messages and their cause.
How do I handle a situation where the code encounters an error condition in the main body of code and goes to an error handler? Should I be testing to see if the recordset is open in the event handler and if so close it or will the recordset close when the sub procedure closes
 

Refresh All goes back to First Record

Preview
In the form I have created, which is recordset type - dynaset (inconsistent updates) - since I have linked in Queries that are based on indeterminate relationships.

I need to click "Refresh All" - since its linked to Queries. When I click "Refresh All" above, it automatically reverts back to the First Record.

How can I keep it on the record in view?

Also - is it possible to have the Form, refresh all on its own, without having to click
 

Is it possible to refresh/requery an open report

Preview
I have a database which I keep open all day - it monitors parcels available for picking and despatch. I've just managed to sort it out so that the data in the tables is refreshed every five minutes, but now I'd like to be able to open the report, leave it open and see changes as they happen.

Is it possible therefore to refresh or requery a report (excepting of course that it can be closed and reopened) automatically?
 

creating a ADODB Recordset and adding records...

Preview
Im trying to dynamically create a ADODB recordset and then add records and then set it as the record source for a form.

What I dont understand is the open statement for the recordset. As I have nothing to open.? until I have added records to it.so what am I missing
 

Open ADO Recordset from Memory

Preview
rs.Open strSQL, {Active Connection}, adOpenStatic, , adCmdText

Is it possible to designate an {Active Connection} such that it allows the recordset to be derived from another ADO recordset already in memory?

Or must I hit the original database again