By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

Problem getting max value

P: n/a
Hello all,
This statement:

Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT Max(Track) AS LastTrack FROM
CDs WHERE CD_ID = " & Me!CD_ID, dbOpenDynaset)

returns a "Too few parameters. Expected 1." error. I've also tried using a
Snapshot. It returns the same error. Am I missing something? Any help is
appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Tom marsh" <le*******@goodwill-suncoast.com> wrote in message news:<bb*****************@twister.tampabay.rr.com> ...
Hello all,
This statement:

Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT Max(Track) AS LastTrack FROM
CDs WHERE CD_ID = " & Me!CD_ID, dbOpenDynaset)

returns a "Too few parameters. Expected 1." error. I've also tried using a
Snapshot. It returns the same error. Am I missing something? Any help is
appreciated.

Tom,

probably you referred to a form-field (Me.CD_ID) in a module and not
in an eventprocedure belonging to a form. 'Me' is only usable in that
context. However you coukd have used there a parameter or an explicit
reference to the form-field like CurrentDB.Forms("myform")!CD_ID

Marc
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.