Hi guys! So after a decade my boss wants me to create a simple visual basic program to track our document routing within the department. I'm having a hard time
So i have these codes:
this works fine but everytime i create another form like add new user, i have to copy everything. Can someone tell me which codes should i transfer to "new module"? and which codes should i call in every form i make? ThanksCode:Dim oRS As ADODB.Recordset Dim sSQL As String Dim i As Integer Dim oConn As ADODB.Connection Set oConn = New ADODB.Connection oConn.Provider = "Microsoft.Jet.OLEDB.4.0" oConn.ConnectionString = "Data Source=" & App.Path & "\tracking.mdb" oConn.Open sSQL = "SELECT username, password, fname FROM users WHERE username = '" & txtusername.Text & "'" Set oRS = New Recordset 'Open our recordset oRS.Open sSQL, oConn If oRS.EOF Then MsgBox "Invalid Username!", vbInformation, "Try Again" Else If oRS.Fields.Item("password") <> txtpassword.Text Then MsgBox "Invalid Password!", vbInformation, "Try Again" txtpassword.SetFocus Else LoginSucceeded = True logged_user = oRS.Fields("fname").Value Me.Hide End If End If oRS.Close oConn.Close





Reply With Quote
