Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i'm stumped: table won't update till requery

Status
Not open for further replies.

Honestmath

Technical User
Jan 8, 2003
25
US
hey,

this problem has me baffled.

i have a table i add a record to using .AddNew . after i do the .Update, i expect to see the new record in the table. i don't. i run this aggregate query that depends on the newly inserted value, and its wrong because the value isn't being added yet.
[bold]
Set rsDB = Me.Recordset
rsDB.AddNew
'put in new rows
rsDB.Update
Me.Requery ' only as a last resort
call RunAggregateQuery
Me.Requery
Me.Bookmark = rsDB.LastModified
[/bold]
on the line 'call RunAggregateQuery' i need the table to be update. i look at the table, and it doesn't update until the line after, Me.Requery (the form is linked to a query that references the table).

why doesn't the table update immediately on the .Update?? how do i force it to update? why would a requery update a table anyway?

thnx so much, i'm really baffled on this one.

math

 
your logic is flawed
the table is being updated after the update but you cant see it until you do the me.requery

the update updates the table. the query wich is a recordset will only update after the me.requery wich makes sure that the recordset used by the form is the same as the table.

i think its all very normal and nothing to worry about Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
hey,

i didn't make myself clear. i'm not looking at the table in the recordset of the form, i'm going into access and opening the table itself. that should have updated immediately with .Update.

i open the table itself, not through any forms, and look at all the records. the new record doesn't appear until i do a requery on the table in my form. that is flawed. i've done it a thousand times before where i add records and look at them while vb is still running and it works. this is messed up.

i tried an 'idle' command, but it did nothing.

thnx, math

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top