Calculate form field using another table, Dim statement

Joined
Apr 13, 2011
Messages
6
Reaction score
0
Hi there,

I have a form for printing costs. I have fields called PrintSize, Quantity and PrintCost. The PrintSize field is a combo box which looks at the values in another table called Printing. The table called printing has a papersize column and a cost column, e.g.
A1 - £4.00
A2 - £3.00 etc.

I want my PrintCost field to automatically be calculated from the PrintSize & Quantity fields by looking at the Printing table. I tried this:

Dim SqlStr As String

SqlStr = "SELECT [Cost] FROM [Printing] WHERE [PaperSize] = '" & PrintSize.Value & "';"*Me.Quantity

PrintCost.Value = SqlStr
PrintCost.Requery

I dont really understand how to use 'Dim' correctly?

Any ideas????


progress.gif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top