lotharious
MIS
when trying to run this vba code I get this error on the rs.open statement.
Run-time Error -2147217904(80040e10)
No value given for one or more required parameters.
[code
Private Sub Completed_by_Change()
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = CurrentProject.Connection
Dim sSQL As String
Me![Date Completed 2] = Date
sSQL = "SELECT [Employees].[Firstname],[Employees].[LastName] FROM [Employees] "
sSQL = sSQL & "WHERE [Employees].[Emp ID]=" & Me![Completed By] & ";"
Debug.Print sSQL
rs.Open sSQL, cn
Me![Who Comp] = rs![Emp ID]
rs.Close
End Sub
[/code]
As this is just the beginning of the change of my form with this Im quite perturbed with this error. I imagine its something quite easy but it has eluded me for a couple hours now.
Run-time Error -2147217904(80040e10)
No value given for one or more required parameters.
[code
Private Sub Completed_by_Change()
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = CurrentProject.Connection
Dim sSQL As String
Me![Date Completed 2] = Date
sSQL = "SELECT [Employees].[Firstname],[Employees].[LastName] FROM [Employees] "
sSQL = sSQL & "WHERE [Employees].[Emp ID]=" & Me![Completed By] & ";"
Debug.Print sSQL
rs.Open sSQL, cn
Me![Who Comp] = rs![Emp ID]
rs.Close
End Sub
[/code]
As this is just the beginning of the change of my form with this Im quite perturbed with this error. I imagine its something quite easy but it has eluded me for a couple hours now.