Topics Search

Refresh open Recordset

Refresh open Recordset
Views: 32
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:

Similar posts...


Recordset get records from Recordset

Recordset get records from Recordset Icon
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

How to refresh table data between closing and opening form Icon
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

Using the Recordset with MS Access and ADO

Using the Recordset with MS Access and ADO Icon
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

Requery vs. Refresh Icon
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

Recordset dilemma

Recordset dilemma Icon
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
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

Refresh All goes back to First Record Icon
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

creating a ADODB Recordset and adding records...

creating a ADODB Recordset and adding records... Icon
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 what am I missing

Is it possible to refresh/requery an open report

Is it possible to refresh/requery an open report Icon
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?

Open ADO Recordset from Memory

Open ADO Recordset from Memory Icon
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

SQL Recordset Versus Filtering

SQL Recordset Versus Filtering Icon
Currently, I have a form that uses SQL to generate a recordset on the "On Open" event. The form's "On Activate" is then used to filter the recordset based on a command button pressed in the calling form.

Instead of doing this two step process, I am contemplating revising the code to move recordset creation from the "On Open" event to the "On Activate" event. This would eliminate the filtering step, but then I would be creating a new recordset each time the form is called. Of course, I would be adding the "Where" clause to the SQL statement.