I am attaching code to the mouseUp event of a button on a form. I want to send some data to a procedure in a sql database that will validate if the password was correct for the user id entered. See code below. What am I doing wrong.
Private Sub Command8_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim UserIDEntered As String
Dim PasswordEntered As String
Dim USER_ID_Returned As Integer
Dim SQLString As String
UserIDEntered = txtUserName.Text ' this doesn't work, it generates an error
PasswordEntered = "Password1234"
SQLString = "SELECT [dbo].[ValidatePassword] ( '" & UserIDEntered & "', '" & PasswordEntered & "')"