nosferatu26
Registered User.
- Local time
- Today, 08:29
- Joined
- Jul 13, 2015
- Messages
- 57
Hello,
I have a list of different user ids that are admins for my database. I am trying to write code to validate a button so only amins can successfully enter a form. the way I have them defined is:
and so on..
I was wondering if it is possible to cycle through these using a for loop instead of comparing each admin id in a really long if statement.
for example, what I currently have is:
on the first iteration, I assign nextAdmin "admin1" but I want it to actually be assigned the reference admin1 points to, instead of the string itself. I just want to cycle through each admin by simply appending the correct number to the end of "admin". I'm new to VBA so I was wondering if there was a way to get this to work without the long if/or statement.
Any help would be greatly appreciated!
I have a list of different user ids that are admins for my database. I am trying to write code to validate a button so only amins can successfully enter a form. the way I have them defined is:
Code:
dim admin1 as string
dim admin2 as string
dim admin3 as string
I was wondering if it is possible to cycle through these using a for loop instead of comparing each admin id in a really long if statement.
for example, what I currently have is:
Code:
For i = 1 To 4
nextAdmin = "admin" & i
If user = nextAdmin Then
validateUser = True
End
End If
Next I
Any help would be greatly appreciated!