Convert Short SQL Query to VB ??

A

ashlanddave

Hi! Self-Taught and struggling a little.

I want to insert a unit price from an order into an order subform
(sbrparts). Each part(or product) has a pricing level of either a or b
(customers that buy more = get a better pricing schedule) AND each part has a
part number (from a combo box) on the subform. Essentially this query will
lookup in table:pricinglevels and partID and PricingLevel to get the
UnitPrice and bring it back into the subparts form. I have stored this query
as unitpricequery and now it's time to insert into subform.

1. How do you insert a query into the control source for Textbox:Unitprice?
Will that then add the field UnitPrice into my subform automatically?

2. Can this query be written as VB and control source be named Unitprice?

Query
----------------------------------------------------------
SELECT Pricinglevels.UnitPrice
FROM Pricinglevels
WHERE ((([FORMS]![sbrparts].[Pricing])=[PricingLevels].[Pricing]) AND
(([FORMS]![sbrparts].[PartID])=[PricingLevels].[PartID]));

Thanks,
AshlandDave
 
P

pietlinden

If you're not going to override the price, why not just base the
subform on the query?
 

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