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

functions/queries - vba - help!

Status
Not open for further replies.

Lavey

IS-IT--Management
Jun 1, 2001
115
DE
hi i'm pretty new to this so bare with me..
i have a 8 coloumn's in a query that are calculated by functions, i now need to use these results in another function - can anybody help me with the syntax?

the full story goes that i have 15 tables of products, each product has 8 variations on price, so for one record i have the following:

[memory_pricing].[128Ram] has buyprice's of 1/5/10/20/50/100/200/500
these are converted to UKprices 1/5/10/20/50/100/200/500 by a function.

because my query [full_product_list] has too many headers i am writing a function to reference the calcualted results in the memory pricing query.

my code looks like this:
Dim P1, P5, P10, P20, P50, P100, P200, P500 As Integer

P1 = [memory Prices.UKPrice1]
P5 = [memory Prices.UKPrice5]
etc

i get a compile error : External name not defined

How do i reference these fields in my query

Any help would be much appreciated!!!
 
Try with:

[memory Prices].[UKPrice1]

Instead of:

[memory Prices.UKPrice1]
 
tried that - same message as before :(
 
Ok. If you want to use the values in the query you have to add a bound field to the report and refere to that field. You can set Visible to False if you don't want to show the textbox for the user. If you let the textbox have the same name as the field you can refere to it by it's name. Example:

P1 = UKPrice1

Else you can open a recordset and do the calculation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top