Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenRecordset ic confusing

Status
Not open for further replies.

Fireman1143

IS-IT--Management
Mar 5, 2002
51
US
With the following code I get a message of "too few parameters expecting 1" and also at another section it says I have one too many )



sql="SELECT * FROM tblInput WHERE (((month([InputDate])) = " & f!month &" AND ((Year([InputDate])) = " & f!year & "0" &' And ((EmployeeID) = " & f!EmployeeID & "))) ORDER BY InputDate;"

Set db = CurrentDB()

Set rs = db.OpenRecordset(sql, dbOpenSnapshot)


As I am just beginning using VB I am not sure of the proper syntax of OpenRecordset.

Fireman1143
 
U r using DAO.. right?

sql = "SELECT * FROM tblInput WHERE (((month([InputDate])) = " & f!month & " AND ((Year([InputDate])) = " & f!year & "0 And ((EmployeeID) = " & f!EmployeeID & "))) ORDER BY InputDate"

You may also need a single quote enclosing the f!EmployeeID etc, if their datatype is text in the db. All the Best
Praveen Menon
pcmin@rediffmail.com
 
Thanks Praveen

I'll print this and give it a shot on Monday.

Fireman1143
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top