Assign the Next Highest Number

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
 
C

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top