RESULT before UPDATE RECORDSET

rickyfong

Registered User.
Local time
Yesterday, 23:59
Joined
Nov 25, 2010
Messages
199
I got a doubt as follows:

No matter it is using ADDNEW or EDIT in recordset, values are assigned to different fields but before doing the UPDATE action, if I assigned those fields to another variables. Those fields content would also be assigned to those variable or only can those fields got values after the UPDATE action!??

FOR INSTANCE, T1 or T2 will got the same result as TRANS1![NAME] and TRANS1![QTY] ??


Dim TRANS1 As Dao.Recordset
Set TRANS1 = CurrentDb.OpenRecordset("select * " & " from MASTER order by INVOICENUM, dbOpenDynaset)

Dim T1 As STRING
DIM T2 as SINGLE

TRANS1.ADDNEW

TRANS1![NAME] = me.NAME
TRANS1![QTY] = ME.HIGH * ME.LENGTH

T1 = TRANS1![NAME]
T2 = TRANS1![QTY]

TRANS1.UPDATE

:
:
:
 
If I understand correctly, move those 2 lines above the lines where you set the recordset fields.
 
Sorry! Paul, I am asking the consequence but not how to solve it !! Thanks!
 
I'm not sure what you're asking. Even though the table has not been updated, the recordset has, so you get the value from the recordset.
 
name is a reserved word, so using it can cause issues -

me.name is the name of your form
 
I think the question really is about the affect of recordset.update

The recordset is in memory, Adding a new record does not write it to the table until the update statement. However the values assigned to the recordset fields are in memory and other variables can be set to hold the same values as in
T2 = TRANS1![QTY]
and will hold the value while in scope whether the recordset is closed with or without an update.
 

Users who are viewing this thread

Back
Top Bottom