PC Review


Reply
Thread Tools Rate Thread

Calculate form field using another table, Dim statement

 
 
New Member
Join Date: Apr 2011
Posts: 6
 
      19th May 2011
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????


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate field with input from different table Andreas Microsoft Access 5 14th Dec 2009 04:13 PM
calculate table field value Portia Microsoft Access 3 7th Nov 2008 08:19 PM
Calculate next 5 numbers from table field Domino Microsoft Access Queries 2 4th Jan 2008 06:46 PM
switch statement to calculate field =?Utf-8?B?TmFuY3k=?= Microsoft Access Forms 12 18th May 2005 04:08 AM
Calculate field in Table. Cam Microsoft Access Database Table Design 2 27th Oct 2003 09:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:36 PM.