Assign the Next Highest Number

  • Thread starter Thread starter Crystal
  • Start date Start date
C

Crystal

We have a table called 'Priority'. Priority Levels are assigned using a
form. If a User does not assign Priority Levels to all of the items, I need
to write something that will check for the Null Priorities, find the Highest
Number already assigned and then number the remaining rows.

I am new to writing VBA. I found that I can find the highest number by using:
HighestPriority: Max([PERIOD_PRIORITY]). I think I would do something like:

Dim HighestPriority as Integer
HighestPriority = Max(Me![PERIOD_PRIORITY])

Use a Counter like For...Next but I'm not sure how to write it.

Any help would be so appreciated!

Crystal
 
This is what I've been able to figure out so far:

Dim FileCount As Integer
Dim Counter As Integer

FileCount =
Counter = DMax("[PERIOD_PRIORITY]", "[Set Priority Level]",
"[PERIOD_PRIORITY] Is Not Null")

Do While Counter <= FileCount
DoCmd.RunSQL
Counter = Counter + 1
Loop
 
Back
Top