Round three :)
I'm finally at the point where I can code the functionality to let my users enter and update information in the application. However, I get the "No value entered for one or more required parameters" error when I try to execute an UPDATE command from an ADODB.Command object.
Code:
Code:
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim strSQL As String
strSQL = "UPDATE tblResident SET " & _
"FirstName = '" & Me.txtFirstName & "', " & _
"LastName = '" & Me.txtLastName & "', " & _
"SupportCoordinator = '" & Me.txtSupportCoordinator & "', " & _
"CFSWorker = '" & Me.txtCFSWorker & "', " & _
"Address = '" & Me.txtAddress & "', " & _
"SocialSecurityNo = '" & Me.txtSSN & "', " & _
"Age = '" & Me.txtAge & "', " & _
"DateOfBirth = '" & Me.txtDateOfBirth & "', " & _
"MakeHealthCareDecision = '" & Me.chkMakeHealthcareDecision & "', " & _
"MotherName = '" & Me.txtMotherName & "', " & _
"MotherAddress = '" & Me.txtMotherAddress & "', " & _
"MotherPhone = '" & Me.txtMotherPhone & "', " & _
"FatherName = '" & Me.txtFatherName & "', " & _
"FatherAddress = '" & Me.txtFatherAddress & "', " & _
"FatherPhone = '" & Me.txtFatherPhone & "', " & _
"OtherRelatives = '" & Me.txtOtherRelatives & "', " & _
"ArrivalDate = '" & Me.txtArrivalDate & "', " & _
"LastUpdate = '" & Me.txtDateUpdated & "' " & _
"WHERE ResidentID = " & Me.cboSelectResident.value
Set cnn = CurrentProject.Connection
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = cnn
.CommandType = adCmdText
.CommandText = strSQL
.Execute
End With
The fields in the UPDATE statement are in the exact order that they appear in the table (tblResident), and all the values appear. Not sure if that even matters... the debugger is flagging the .Execute method as being the troublemaker. However, I must be missing something because I can't see where the problem lies. Any ideas what I'm missing and how to fix it?
Thanks yet again for the help.. I really appreciate it as I learn VBA.