mloucel
Member
- Local time
- Yesterday, 23:21
- Joined
- Aug 5, 2020
- Messages
- 180
Hello all:
Have you ever been in a moment where you cannot find the most obvious answer to a simple question?
That's where I am..
I have an issue with a particular continuous Form and verifying data without using a button and Using DLOOKUP..
I have a Table Of Users that will have a user Name / password / Level / Active (FORM SOURCE is of course my table UsersT)
- so all is OK, I created the Form (Continuous) so that I can see all the users and ADD or Set INACTIVE.
- The form can only be used by ADMINS so when open the form they MUST enter a password, [easy and is done.]
- I check that ALL the fields are NOT NULL (you never know with users even if they are admins) I know the focus is always in Username when they start, so I use the On Lost Focus event to check if the field is null, and so with all the other fields except ACTIVE [set to true] and LEVEL [set to user] forcing the user to enter something there.
Issue:
- When they enter the user name I have to check if that field is already in the table [UsersT], and if so display a message to the user and force a UserName.setfocus [Which does not work BTW, it does not go back to UserName],
The form record source is the table [UsersT], but no matter how I try, the dlookup gives me errors and glitches and so forth:
[dlookup("UserName", "UserT", "RIGHT HERE IS MY PROBLEM, WHAT DO I DO?")]
I know I can solve that with a different type of form [Not Continuous Form] and a button, sure, but I love the idea of the continuous form since it is easier to check for all the other users and make changes in a snap.
But how can I check that the UserName does not exist in UserT, and if it does MsgBox "User Name already exists, must use a different one ", vbokonly
then UserName.SetFocus, and force the user to correct the user name, I am using UserName=" " before SetFocus
Yes for many of you is so simple but I am a newbie here and is the first time working with continuous forms,
ANY HELP will be appreciated.
Maurice.
Have you ever been in a moment where you cannot find the most obvious answer to a simple question?
That's where I am..
I have an issue with a particular continuous Form and verifying data without using a button and Using DLOOKUP..
I have a Table Of Users that will have a user Name / password / Level / Active (FORM SOURCE is of course my table UsersT)
- so all is OK, I created the Form (Continuous) so that I can see all the users and ADD or Set INACTIVE.
- The form can only be used by ADMINS so when open the form they MUST enter a password, [easy and is done.]
- I check that ALL the fields are NOT NULL (you never know with users even if they are admins) I know the focus is always in Username when they start, so I use the On Lost Focus event to check if the field is null, and so with all the other fields except ACTIVE [set to true] and LEVEL [set to user] forcing the user to enter something there.
Issue:
- When they enter the user name I have to check if that field is already in the table [UsersT], and if so display a message to the user and force a UserName.setfocus [Which does not work BTW, it does not go back to UserName],
The form record source is the table [UsersT], but no matter how I try, the dlookup gives me errors and glitches and so forth:
[dlookup("UserName", "UserT", "RIGHT HERE IS MY PROBLEM, WHAT DO I DO?")]
I know I can solve that with a different type of form [Not Continuous Form] and a button, sure, but I love the idea of the continuous form since it is easier to check for all the other users and make changes in a snap.
But how can I check that the UserName does not exist in UserT, and if it does MsgBox "User Name already exists, must use a different one ", vbokonly
then UserName.SetFocus, and force the user to correct the user name, I am using UserName=" " before SetFocus
Yes for many of you is so simple but I am a newbie here and is the first time working with continuous forms,
ANY HELP will be appreciated.
Maurice.