G
Guest
hi everyone, i have the following ADO code in an access2003 database, which
isnt working. its supposed to bring up the city that a building belongs to
and put it into the city field, it looks right but when it gets to the
rstCity.Open line it throws up the following runtime error:
Run time error '-214721.....(80040e10)'
No value given for one of more required paramters.
<!----------
Dim ConDatabase As ADODB.Connection
Dim rstCity As ADODB.Recordset
Dim strSql As String
' Initialize Connection object
' Specify current database as the Provider and then open the database
Set ConDatabase = CurrentProject.Connection
Set rstCity = New ADODB.Recordset
strSql = "SELECT CITY" & " FROM STUDENTROOMS where (BUILDING = '" &
Forms!studentsnew!Building & "');"
rstCity.Open strSql, ConDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText
'Me![City] = rstFlat.Fields(0).Value
' Close Connection object and destroy object variable.
rstCity.Close
ConDatabase.Close
Set rstCity = Nothing
Set ConDatabase = Nothing
------------------->
whats going on
isnt working. its supposed to bring up the city that a building belongs to
and put it into the city field, it looks right but when it gets to the
rstCity.Open line it throws up the following runtime error:
Run time error '-214721.....(80040e10)'
No value given for one of more required paramters.
<!----------
Dim ConDatabase As ADODB.Connection
Dim rstCity As ADODB.Recordset
Dim strSql As String
' Initialize Connection object
' Specify current database as the Provider and then open the database
Set ConDatabase = CurrentProject.Connection
Set rstCity = New ADODB.Recordset
strSql = "SELECT CITY" & " FROM STUDENTROOMS where (BUILDING = '" &
Forms!studentsnew!Building & "');"
rstCity.Open strSql, ConDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText
'Me![City] = rstFlat.Fields(0).Value
' Close Connection object and destroy object variable.
rstCity.Close
ConDatabase.Close
Set rstCity = Nothing
Set ConDatabase = Nothing
------------------->
whats going on