L
laavista
I have two tables-- t_credits and t_CreditsUsed. I’m checking to see if
any credits were entered in the table t_credits, and if so, I’m adding a
record in t_CreditsUsed with the appropriate info. My “movenext†is not
working. It goes through the first record fine, but does not move to the 2nd
record in the t_credits table.
Help?!
The code:
Set db = CurrentDb
Set rstTCredits = db.OpenRecordset("t_Credits", dbOpenDynaset)
Set rstCreditsUsed = db.OpenRecordset("t_CreditsUsed", dbOpenDynaset)
longNumRecords = DCount("*", "t_credits")
If longNumRecords < 1 Then
' ' there's no credits in credits table
GoTo Resumeit
End If
rstTCredits.MoveFirst
intTempCreditsApplied = rstTCredits!TEMP_Credits_Applied
longintCreditsID = rstTCredits!CreditsID
intCounter = 1
For intCounter = 1 To longNumRecords
If intTempCreditsApplied < 1 Then
GoTo GetNextRecord
End If
rstCreditsUsed.AddNew
rstCreditsUsed!CreditsID = longintCreditsID
rstCreditsUsed!CreditsUsed = intTempCreditsApplied
rstCreditsUsed!TripsReservID = longintTripsReservid
rstCreditsUsed.Update
GetNextRecord:
rstTCredits.MoveNext
Next
…
THANKS for your help.
any credits were entered in the table t_credits, and if so, I’m adding a
record in t_CreditsUsed with the appropriate info. My “movenext†is not
working. It goes through the first record fine, but does not move to the 2nd
record in the t_credits table.
Help?!
The code:
Set db = CurrentDb
Set rstTCredits = db.OpenRecordset("t_Credits", dbOpenDynaset)
Set rstCreditsUsed = db.OpenRecordset("t_CreditsUsed", dbOpenDynaset)
longNumRecords = DCount("*", "t_credits")
If longNumRecords < 1 Then
' ' there's no credits in credits table
GoTo Resumeit
End If
rstTCredits.MoveFirst
intTempCreditsApplied = rstTCredits!TEMP_Credits_Applied
longintCreditsID = rstTCredits!CreditsID
intCounter = 1
For intCounter = 1 To longNumRecords
If intTempCreditsApplied < 1 Then
GoTo GetNextRecord
End If
rstCreditsUsed.AddNew
rstCreditsUsed!CreditsID = longintCreditsID
rstCreditsUsed!CreditsUsed = intTempCreditsApplied
rstCreditsUsed!TripsReservID = longintTripsReservid
rstCreditsUsed.Update
GetNextRecord:
rstTCredits.MoveNext
Next
…
THANKS for your help.