I keep getting the error "No value given for one or more required
parameters", but not sure why. Can anyone please look at my code snipet
and see if you see any reason why I could be getting this error. I am
just trying to update a record using MS Access 2003 as the front end.
This code is in VB.NET
Private Sub cmdUpdate_Click ()
On Error GoTo Err_cmdUpdate_C lick
Dim rstUsers As New ADODB.Recordset
Dim fld As ADODB.Field
Dim strField As String
Dim strSQL As String
strSQL = "select dbo_tbl_Users.* from dbo_tbl_Users " & "where
dbo_tbl_Users!E mpRec=" & "'" & Me.cboEmpRec & "'"
rstUsers.Open strSQL, CurrentProject. Connection, adOpenKeyset,
adLockOptimisti c
If Not IsNull(Me.cboEm pRec.value) Then
rstUsers!EmpRec = Me.cboEmpRec.va lue
End If
If Not IsNull(Me.txtEm pID) Then
rstUsers!EmpID = Me.txtEmpID
Else
MsgBox "Please enter an employee number", vbOKOnly
GoTo Exit_cmdUpdate_ Click
End If
If Not IsNull(Me.txtEm pName) Then
rstUsers!EmpNam e = Me.txtEmpName
Else
MsgBox "Please enter an employee name", vbOKOnly
GoTo Exit_cmdUpdate_ Click
End If
If Not IsNull(Me.cboSt atus.value) Then
rstUsers!Status = Me.cboStatus.va lue
Else
MsgBox "Please enter a status for the employee", vbOKOnly
GoTo Exit_cmdUpdate_ Click
End If
If Not IsNull(Me.txtUN ame) Then
rstUsers!UserNa me = Me.txtUName
Else
MsgBox "Please enter a user name for the employee", vbOKOnly
GoTo Exit_cmdUpdate_ Click
End If
If Not IsNull(Me.txtPa ss) Then
rstUsers!Passwo rd = Me.txtPass
Else
MsgBox "Please enter a password for the employee", vbOKOnly
GoTo Exit_cmdUpdate_ Click
End If
rstUsers.Update
rstUsers.Close
MsgBox "Employee Record has been updated successfully.", vbOKOnly
DoCmd.Close
cboEmpRec = Null
txtEmpID = Null
txtEmpName = Null
txtPass = Null
cboStatus = Null
txtUName = Null
Set rstUsers = Nothing
Exit_cmdUpdate_ Click:
Exit Sub
Err_cmdUpdate_C lick:
MsgBox Err.Description
Resume Exit_cmdUpdate_ Click
End Sub
*** Sent via Developersdex http://www.developersdex.com ***