T
TallyJasin
I am getting the error: No value given for one or more required parameters.
The line in my code that is having the problem is:
rs2.Open sSQL, CurrentProject.Connection, adOpenStatic
Does anyone have any ideas?
The code is as follows:
Dim rs As ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim sSQL As String
On Error GoTo Err_Current
Set rs = New ADODB.Recordset
editper = Forms![requests]![Subrequests].Form![StaffID]
'Make the SQL select statment.
sSQL = "SELECT firstname, lastname " & _
"FROM Customers " & _
"WHERE customers.CustID = " & editper
'adOpenStatic makes it readonly. Read up on ADO if you want to edit the data
rs.Open sSQL, CurrentProject.Connection, adOpenStatic
If rs.RecordCount > 0 Then
custname = rs!firstname & "." & rs!Lastname
End If
rs.Close
Set rs = Nothing
editper2 = Forms![requests]![Subrequests].Form![Text56]
'Make the SQL select statment.
sSQL = "SELECT currentuser " & _
"FROM editusers " & _
"WHERE editusers.currentuser = " & editper2
'adOpenStatic makes it readonly. Read up on ADO if you want to edit the data
rs2.Open sSQL, CurrentProject.Connection, adOpenStatic
If rs2.EOF Then
'no records
Else
GoTo Exit_Current:
End If
rs2.Close
Set rs2 = Nothing
The line in my code that is having the problem is:
rs2.Open sSQL, CurrentProject.Connection, adOpenStatic
Does anyone have any ideas?
The code is as follows:
Dim rs As ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim sSQL As String
On Error GoTo Err_Current
Set rs = New ADODB.Recordset
editper = Forms![requests]![Subrequests].Form![StaffID]
'Make the SQL select statment.
sSQL = "SELECT firstname, lastname " & _
"FROM Customers " & _
"WHERE customers.CustID = " & editper
'adOpenStatic makes it readonly. Read up on ADO if you want to edit the data
rs.Open sSQL, CurrentProject.Connection, adOpenStatic
If rs.RecordCount > 0 Then
custname = rs!firstname & "." & rs!Lastname
End If
rs.Close
Set rs = Nothing
editper2 = Forms![requests]![Subrequests].Form![Text56]
'Make the SQL select statment.
sSQL = "SELECT currentuser " & _
"FROM editusers " & _
"WHERE editusers.currentuser = " & editper2
'adOpenStatic makes it readonly. Read up on ADO if you want to edit the data
rs2.Open sSQL, CurrentProject.Connection, adOpenStatic
If rs2.EOF Then
'no records
Else
GoTo Exit_Current:
End If
rs2.Close
Set rs2 = Nothing