Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL server Northwind UnitPrice demystifying. Expand / Collapse
Author
Message
Posted Thursday, March 11, 2010 3:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 22, 2010 5:17 AM
Points: 4, Visits: 10
in the MS Access version of Northwind to get the Unit price on selected index change of product. they intoduce a GetListPrice in the code behind of Order Subform. Like:

Option Compare Database
Option Explicit


Private Sub Product_ID_AfterUpdate()
'Initialize price and discount for each product change
If Not IsNull(Me![Product ID]) Then
Me![Quantity] = 0
Me.Quantity.Locked = False
Me![Unit Price] = GetListPrice(Me![Product ID])
Me![Discount] = 0
Me![Status ID] = None_OrderItemStatus


'Empty Product records mean user wants to delete line item
Else
eh.TryToRunCommand acCmdDeleteRecord
End If
End Sub



Now on the SQL server 2008 version there a similar database however everything seems to work somehow like a well oiled engine without the code behind. ummm...
How is this achieved automatically calling the ListPrice from the Product table based on OrderItem selected product. Am I missing smething? Can anyone demystify this?
Post #880856
Posted Friday, March 12, 2010 5:53 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
Um, what forms are you running on your SQL 2008 database? Because unlike Access, SQL Server does not have a Forms system of its own, you have to use forms from some other facility...?

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #881676
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse