Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2006, 01:55 AM
Dale
Guest
 
Posts: n/a
Default Error: too few parameters, expected 2

Access 2003 frt end attached to sql 2000 backend

I am trying to check for an existing record but cannot get past this
error,

too few parameters, expected 2

I have verified that all fields exist and tested the query.

It appears to occur on the Set Rec Line

Dim db As DAO.Database
Dim Rec As DAO.Recordset
Set db = CurrentDb
Dim qry As String


qry = "SELECT tblMedInfo.ClientID, tblMedInfo.DateEntered FROM
tblMedInfo WHERE
(((tblMedInfo.ClientID)=[Forms]![frmClients]![ClientID]) AND
((tblMedInfo.DateEntered)=[Forms]![frmClients]![LastUpdate]));"

Set Rec = db.OpenRecordset(qry, dbOpenDynaset, dbSeeChanges)

If Rec.RecordCount 0 Then
MsgBox "Record Exsist"
Else
MsgBox "Will Open And Add Record"
End If

Any Help Always Appreciated
Dale

  #2  
Old November 13th, 2006, 04:25 AM
Svetlana
Guest
 
Posts: n/a
Default Re: Error: too few parameters, expected 2

qry = "SELECT tblMedInfo.ClientID, tblMedInfo.DateEntered " & _
"FROM tblMedInfo WHERE tblMedInfo.ClientID=" &
[Forms]![frmClients]![ClientID] & _
" AND tblMedInfo.DateEntered=#" & _
Format([Forms]![frmClients]![LastUpdate], "yyyy/mm/dd") & "#;"

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles