By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,365 Members | 3,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,365 IT Pros & Developers. It's quick & easy.

Error: "No value given for one or more required parameters

P: n/a
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_Click

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!EmpRec=" & "'" & Me.cboEmpRec & "'"
rstUsers.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
If Not IsNull(Me.cboEmpRec.value) Then
rstUsers!EmpRec = Me.cboEmpRec.value
End If

If Not IsNull(Me.txtEmpID) Then
rstUsers!EmpID = Me.txtEmpID
Else
MsgBox "Please enter an employee number", vbOKOnly
GoTo Exit_cmdUpdate_Click
End If
If Not IsNull(Me.txtEmpName) Then
rstUsers!EmpName = Me.txtEmpName
Else
MsgBox "Please enter an employee name", vbOKOnly
GoTo Exit_cmdUpdate_Click
End If

If Not IsNull(Me.cboStatus.value) Then
rstUsers!Status = Me.cboStatus.value
Else
MsgBox "Please enter a status for the employee", vbOKOnly
GoTo Exit_cmdUpdate_Click
End If

If Not IsNull(Me.txtUName) Then
rstUsers!UserName = Me.txtUName
Else
MsgBox "Please enter a user name for the employee", vbOKOnly
GoTo Exit_cmdUpdate_Click
End If

If Not IsNull(Me.txtPass) Then
rstUsers!Password = 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_Click:
MsgBox Err.Description
Resume Exit_cmdUpdate_Click

End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Aug 23 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.