[AccessD] A2K: Can anyone tell me why this fails?

Bryan Fitzpatrick bryan.fitzpatrick at cyberone.com.au
Tue Feb 17 23:28:57 CST 2004


Try this SQL string:

selSQL = "SELECT tblStudents.StudentID, tblStudents.FormattedStudentID FROM tblStudents WHERE
(((tblStudents.FormattedStudentID)=" & [Forms]![frmStudentSearch].[txtStudentIDSearch]" & "))"


HTH
Bryan



Darren DICK wrote:

>Hello all
>I get a very long runtime error number along with the text...
>No value given for one or more required parameters
>
>The sql string works well as a query
>'###########################################
>Dim selSQL As String
>Dim rs As Object
>Dim con As Object
>
>selSQL = "SELECT tblStudents.StudentID, tblStudents.FormattedStudentID FROM tblStudents WHERE
>(((tblStudents.FormattedStudentID)=[Forms]![frmStudentSearch]![txtStudentIDSearch]));"
>
>Set rs = CreateObject("ADODB.Recordset")
>Set con = Application.CurrentProject.Connection
>
>rs.Open selSQL, con, 1, 3 '<=====DEBUG YELLOWS OUT THIS LINE
>
>    With rs
>        .MoveFirst
>        .MoveLast
>        .MoveFirst
>        MsgBox .RecordCount
>    End With
>'###########################################
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>  
>





More information about the AccessD mailing list