V
VALERIA
Guest
I am trying to assign a value to a field using vb. I have already used an auto number for another field, so i definitely have to write the code for this one. I need to assign a number to a field in increments of 1 and the starting number is on a query. Any ideas? The code i have so far is below.
Dim JRNNEXT As Variant
'Loop through unposted journal entries
Do Until rstJournalEntriesToPost.EOF
' Find the next Journal Entry Number
JRNNEXT = DLookup("JRNNEXT", "qry_JENextNumber")
JRNNEXT = JRNNEXT + 1
rstJournalEntriesToPost.Edit
rstJournalEntriesToPost!JRNENTRY = JRNNEXT
rstJournalEntriesToPost.Update
JRNNEXT = JRNNEXT + 1
rstJournalEntriesToPost.MoveNext
Loop