Recent content by solrac_otos

  1. S

    Extract First Name from Username for Welcome Screen

    Hi there. I have a module that pulls the user name in the firstname.lastname format. This is the module (module name is fosUserName): Public Function GetUser() As String Dim WNet As Object Set WNet = CreateObject("WScript.Network") GetUser = WNet.UserName End Function I...
  2. S

    UserName and Password for a DB

    The forms control source is a table: DB-USERS cmbdbUserName is bound to empName I only brought in empName column into that combo box. Does this make sense?
  3. S

    UserName and Password for a DB

    Gosh I cant believe I missed that too. Okay. Fixed. Now ran the code entered a valid username and password and I get the "you do not have access to the database, please contact admin" msgbox.. The if thens on the empty fields is working properly. Ideas? Private Sub cmdDBLogin_Click() If...
  4. S

    UserName and Password for a DB

    Agh! Ok. Fixed that. I do not get an error any more but the code isnt working. Says I cannot leave the password empty when I purposely put in the correct password or left it empty to test the code. The code looks right but its not working how it should. Any ideas? Private Sub...
  5. S

    UserName and Password for a DB

    Here is the code. Sorry...I still don't see where the issue is. I am relatively new to VBA. Private Sub cmdDBLogin_Click() If Len(Me.cmbdbUserName & vbNullString) = 0 Then MsgBox "You cannot leave the UserName field empty, please try again.", vbCritical Exit Sub End Sub...
  6. S

    UserName and Password for a DB

    Seems pretty straight forward. I tweaked it to use all of my object names and ran it but got the error: Compile error: Block If without End If When I click ok and it takes me to the code it highlights the top line below: Private Sub cmdDBLogin_Click() If Len(Me.cmbdbUserName &...
  7. S

    UserName and Password for a DB

    Good morning all. I would like to implement a login form to my DB. I have a table db-users with three fields: empID; empName; empPassword I have a form with an unbound combo box: cmbdbUserName And I have a text box: txtPassword where the user will type in their password. cmdDBLogin is the...
  8. S

    How do I capture the windows log on information of a user using a database?

    Thanks all. I worked this all out thanks to the input. -C.
  9. S

    How do I capture the windows log on information of a user using a database?

    Ok...but what is the code for pulling the user name information? Thats the part I am really stuck on :-/ Thanks for the reply.
  10. S

    Adding onbeforeupdate vb code to account for missing required fields

    Thanks for all the help on this thread Paul. You were invaluable!!! I posted another thread on this same forum: How do I capture the windows log on information of a user using a database? If you can help with that one as well...it would be appreciated. Cheers. -C.
  11. S

    How do I capture the windows log on information of a user using a database?

    I was hoping someone could help me with this. I have several data entry forms in my DB. What I would like to do is capture the windows user name of the people adding records and changing records. How do I go about doing that? I was think of an on change event to a given field that would then...
  12. S

    Adding onbeforeupdate vb code to account for missing required fields

    Paul...conditional formatting? Can you elaborate...maybe give me an example on how I would apply it to my code?
  13. S

    Adding onbeforeupdate vb code to account for missing required fields

    Paul. Worked like a charm! How do I get the setfocus to apply to the the first field where the if then finds a blank field? Here is the code as it stands. Private Sub cmdSaveButton_Click() If Len(Me.cmbModel & vbNullString) = 0 Or Len(Me.txtSerialNo & vbNullString) = 0 Or...
  14. S

    Adding onbeforeupdate vb code to account for missing required fields

    Paul. Many thanks. I have left for the day and will try this out Monday morning. I will report back when I have implemented and tested the code. Cheers. C.
  15. S

    Adding onbeforeupdate vb code to account for missing required fields

    Agh. Okay. While I was waiting for your reply I started hacking at it myself. I am taking a slightly different approach. On the Save button I created an on click private sub: Private Sub cmdSaveButton_Click() If Len(Me.txtSerialNo & vbNullString) = 0 Then MsgBox "You need to fill in all...
Back
Top Bottom