I have a form that verifies username and password (from tblPeople) and this is working fine. I need to include in the button click event code that will add a record to the sub form or sub table named tblLogin that would include the UserName, Password and also enter TimeIn (Now()) into a new record in the sub form.
Here is the code for the button so far:
Private Sub Command12_Click()
If Combo8.Value = UserName.Value And Text10.Value = Password.Value Then
MsgBox "match" 'used to test, will remove this msgbox
'use variables to enter data into subform
Dim Uname As String
Dim Pcode As String
Uname = Combo8.Value
Pcode = Text10.Value
'need code here to put data into subform named tblLogin_Subform
'table name is "tblLogin" and fields are "UserName", "Password", "TimeIn"
Combo8 = ""
Text10 = ""
Else
MsgBox "Password does not match, please reenter"
Text10 = ""
Me.Text10.SetFocus
End If
End Sub
thanks, onemadjan
Start Free Trial