Hello everybody,
I'm trying to create a query which displays records from a table but with some modifications.
I tried the following simple code which updates directly the source table. Could you tell me what's missing to display the modifications only in a query without modifying the source table ?
Thanks a lot because this is making me crazy...
Dim curDatabase As Database
Dim MySet As Recordset
Dim MyQu As QueryDef
Dim strStatement As String
strStatement = "SELECT * FROM [PP 02 RESS] "
Set curDatabase = CurrentDb
Set MySet = curDatabase.OpenRecordset(strStatement, dbOpenDynaset)
MySet.MoveFirst
If MySet![Plnt] = "0010" Then
MySet.AddNew
MySet![Plnt] = "0099"
MySet.Update
MySet.Bookmark = MySet.LastModified
End If
I'm trying to create a query which displays records from a table but with some modifications.
I tried the following simple code which updates directly the source table. Could you tell me what's missing to display the modifications only in a query without modifying the source table ?
Thanks a lot because this is making me crazy...
Dim curDatabase As Database
Dim MySet As Recordset
Dim MyQu As QueryDef
Dim strStatement As String
strStatement = "SELECT * FROM [PP 02 RESS] "
Set curDatabase = CurrentDb
Set MySet = curDatabase.OpenRecordset(strStatement, dbOpenDynaset)
MySet.MoveFirst
If MySet![Plnt] = "0010" Then
MySet.AddNew
MySet![Plnt] = "0099"
MySet.Update
MySet.Bookmark = MySet.LastModified
End If