B
bullman bullman via AccessMonster.com
I'm trying to add a button that find a record in a table and populates text
boxes on the form. I have a query that sets the criteria equal to the text
I want the record for. My code is:
Dim rst As Recordset
Dim db As Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT History.Drawing, History.[Total Laser Cutting], History.
[Total Price], History.[Total Discounted Price]FROM History WHERE
History.Drawing=[Enter Drawing #];"
Set rst = db.OpenRecordset(strSQL)
Me.TOTAL_PRICE = rst.Fields("Total Price")
Me.DiscountTotal = rst.Fields("Total Discounted Price")
I'm getting an error message "Run-Time error 3061'. To few parameters.
Expected 1. Can anyone tell me where I've messed up? Thanks.
boxes on the form. I have a query that sets the criteria equal to the text
I want the record for. My code is:
Dim rst As Recordset
Dim db As Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT History.Drawing, History.[Total Laser Cutting], History.
[Total Price], History.[Total Discounted Price]FROM History WHERE
History.Drawing=[Enter Drawing #];"
Set rst = db.OpenRecordset(strSQL)
Me.TOTAL_PRICE = rst.Fields("Total Price")
Me.DiscountTotal = rst.Fields("Total Discounted Price")
I'm getting an error message "Run-Time error 3061'. To few parameters.
Expected 1. Can anyone tell me where I've messed up? Thanks.