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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select current record from list on form

Status
Not open for further replies.

threadgills

Technical User
May 29, 2003
34
US
I have a form that lists open work orders that is based on my main table. I want to be able to click on a particular work order and give the details from another table, mainly the sum of the revenue.
The textbox on my form (frm_Main1) is named WRNumber. Here is my statement:

Set rs = CurrentDb.OpenRecordset("SELECT WONumber, Sum(REVENUE) AS SumOfREVENUE FROM tbl_Details2 where tbl_details2.wonumber = form_frm_Main1.WRnumber group by wonumber")

I get a "Too few parameters. Expected 1" error.

What am I missing?

Thanks!
 
Hi!

This is proper syntax:

Set rs = CurrentDb.OpenRecordset("SELECT WONumber, Sum(REVENUE) AS SumOfREVENUE FROM tbl_Details2 where tbl_details2.wonumber = " & Forms!frm_Main1!WRnumber & " Group By wonumber")

hth


Jeff Bridgham
bridgham@purdue.edu
 
You're a life saver!!!!!!!! It's amazing that if you don't have it as text, it ain't gonna work! ;)

Thanks!
 
Wow! I've never saved someone's life before! Can't wait to tell my wife! :)



Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top