[access 2000] how do i "if x do not open form"?

ed_the_unlucky

Registered User.
Local time
Today, 13:45
Joined
Jan 28, 2008
Messages
30
OK, i think i'm missing something incredibly simple here.

i have a form that opens when a command button is pressed. i want for it not to open when [criteria] is met (based upon winusername). i can get the winusername w/out any trouble, but i don't understand how to tell access to use that criteria to preclude opening the form.

my gut tells me this is actually a VBA issue, but as i don't know VBA very well, i'm at a loss. ideally, i would prefer to tell the button to abort opening the form, although if there's another way to accomplish this, i'm all ears.

ed
 
Yes, using VBA you can do this in the On Open event:
Code:
If YourUserName <> "WhateverHere" Then
  Cancel = True
End If
 
bob, thank you both for the very simple response as well as its speed.

much obliged!

ed
 

Users who are viewing this thread

Back
Top Bottom