So I have a table called "users" and a form created from that table with some of the fields, including
- First_name
- Last_name
- address
- windowsID
The table has existing records and the purpose of this form is to manage it for future new users to be added.
I wrote a sub and put it to the email setfocus method that automatically takes the first letter of the first_name and the full last name to create the email as well as add the @gmail.com part
Expand|Select|Wrap|Line Numbers
- email.text = (Mid(first_name.value,1,1) & Mid(last_name.value,1) & "@gmail.com")
Expand|Select|Wrap|Line Numbers
- windowsID.text = (Mid(first_name.value,1,2) & Mid(last_name.value,1,1))
i want to make sure that if the previous records are already populated with text, do not update the field using the code above. the stuff above will only "run" when there's a new record added. also have some kind of validation that if they click on the email field without putting in their firstname and lastname, a msgbox will appear telling them to fill in whichever is blank.
Thanks!
hope this isn't too hard to accomplish.