Hi all,
I am interested in learning VBA and have set myself a small assignment. But i am facing a problem and will be glad if any one of you be of some assistance.
My idea is to fetch data from database based on a given table name. While connecting, in order to make the program more interactive i thought of adding a Login Form for User. One of the Worksheets will have a button for FetchData operation and on button click, i will load a user form which will accept details from User. I am well set till entering and collecting data but i am having trouble validating the data entered in Text Boxes. My requirement is not to have User_Name and Password section empty.
Here is my skeletal code :
In worksheet Module :
In Form Module
Here after entering the details in the shown Login Form , TextBox validations should happen after i click submit button. If the textboxe/s are empty a smg should pop asking to fill the required fields and focus is to be set on that field.
i gathered some info and came to know that there is some Me.Dirty operation to check for change in dta and a BeforeUpdate event on Form will trigger. But i am not able to get past this point. The Login Form should close only after all the required fileds are entered by user and i guess i can use cmd.close or unload options to get back to my worksheet modules.
Please help me crack this code.
TIA
HarrY
Bookmarks