Locopete99
Registered User.
- Local time
- Today, 09:15
- Joined
- Jul 11, 2016
- Messages
- 163
Hi Guys,
I'm self taught on VBA and access and I have an issue that I cant figure out.
I have 2 tables, one with the current progress of a user through a learning module.
The second is a results table to show how many sections of that module the user has completed.
I'll then join this to another table later for further use.
So both tables are the same and have the same fields:
ID
MODULE 1
MODULE 2
MODULE 3
(But with actual module names.)
What I want to do is run an update on this. However I dont want a blanket update, I only want to update fields where the progress table is higher then the results table. (If you didn't work on a module that day it will show a 0 on the export/ import which would overwrite the current progress.)
I've tried many ways to do this, my latest is below. Can someone help?
I know this code isn't complete. I just wanted to give you an idea of what i'm trying.
Thanks
I'm self taught on VBA and access and I have an issue that I cant figure out.
I have 2 tables, one with the current progress of a user through a learning module.
The second is a results table to show how many sections of that module the user has completed.
I'll then join this to another table later for further use.
So both tables are the same and have the same fields:
ID
MODULE 1
MODULE 2
MODULE 3
(But with actual module names.)
What I want to do is run an update on this. However I dont want a blanket update, I only want to update fields where the progress table is higher then the results table. (If you didn't work on a module that day it will show a 0 on the export/ import which would overwrite the current progress.)
I've tried many ways to do this, my latest is below. Can someone help?
Code:
Private Sub Label0_Click()
Dim BEG As String
Dim LastID As String
With CurrentDb
Set rsnew = CurrentDb.OpenRecordset("Tbl_progress", dbOpenDynaset)
If rsnew.RecordCount > 0 Then
rsnew.MoveFirst
Do Until rsnew.EOF
BEG = DLookup("Beginner", "Tbl_Results", tbl_results.ID2 = Tbl_progress.ID)
With rsnew
If BEG > [Beginner] Then
![Beginner] = BEG
Else
End If
End Sub
I know this code isn't complete. I just wanted to give you an idea of what i'm trying.
Thanks