Rocky Smolin - Beach Access Software
bchacc at san.rr.com
Tue Nov 4 23:08:18 CST 2003
Darren: Can't see why offhand but I would put MsgBox "*" & [Forms]![frmAssesments]![txtResultID] & "*" right before the Set rs statement to see if there's a valid value for the ID coming from the form. Or put MsgBox strSQL right before the Set rs statement to see the whole thing. Sometimes it shows up a little syntax error that I just can't see looking at the code. Also do you think you might have to surround the [Forms]![frmAssesments]![txtResultID] with Val(), like Val([Forms]![frmAssesments]![txtResultID]))? Just a guess. Rocky ----- Original Message ----- From: "Darren DICK" <d.dick at uws.edu.au> To: "AccessD List" <AccessD at databaseadvisors.com> Sent: Tuesday, November 04, 2003 8:07 PM Subject: [AccessD] A2K: Too Few Paramaters. Expected 1 > Hello all > Can anyone tell me why I am getting the dreaded Too Few Paramaters blah blah blah error message when > I run the code below?? The code is almast exact of something else that is running quite well on the same form. > > Many thanks > > Darren > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. > Dim db As Database > Dim rs As Recordset > Dim strSQL As String > Dim x As Long > > Set db = CurrentDb() > > strSQL = "SELECT tblAssesmentResults.AssesmentResultID, tblAssesmentResults.ResultID FROM tblAssesmentResults WHERE > (((tblAssesmentResults.ResultID)=[Forms]![frmAssesments]![txtResultID]));" > > Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot) > > With rs > 'If Not .EOF Then > x = rs.RecordCount > MsgBox x > 'End If > .Close > End With > > Set rs = Nothing > db.Close > Set db = Nothing > > > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >