T
Thomas
Hello all I am working on a database for a small Tile retail store.
I could use some help on how to lookup different price codes.
Then place the amount into the Orders Subform!UnitPrice TextBox.
I have the user select from a Options Group Check boxes
Retail, Contractor, Dealer
--------------------------------------------------------------------------
Option Group PriceCode
Control Source = PriceCodeID
In the orders Table (FieldName PriceCodeID)
--------------------------------------------------------------------------
The CheckBoxes
Retail
Option Value =1
Contractor
Option Value = 2
Dealer
Option Value =3
-----------------------------------------------------------------------
Products Table
FieldName DataType Caption Name
ProductID = AutoNumber
ProductName = Text
1 = Currency Retail
2 = Currency Contractor
3 = Currency Dealer
----------------------------------------------------------------------
Orders_SubForm.Form Code
Private Sub ProductID_AfterUpdate()
On Error GoTo Err_ProductID_AfterUpdate
Dim strFilter As String
strFilter = "ProductID = " & Me!ProductID
(Look up product's unit price and assign it to UnitPrice control.)
Me!UnitPrice = DLookup("[1]", "Products", strFilter)
Exit_ProductID_AfterUpdate:
Exit Sub
Err_ProductID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ProductID_AfterUpdate
End Sub
------------------------------------------------------------------
I replace the number 1 with 2
I get the Contractor Price
I replace the number 1 with 3
I get the Dealer Price
Can this be accomplished with Code ?
Any Help or other methods
Ms Access 2003
Thanks in Advance
Thomas
I could use some help on how to lookup different price codes.
Then place the amount into the Orders Subform!UnitPrice TextBox.
I have the user select from a Options Group Check boxes
Retail, Contractor, Dealer
--------------------------------------------------------------------------
Option Group PriceCode
Control Source = PriceCodeID
In the orders Table (FieldName PriceCodeID)
--------------------------------------------------------------------------
The CheckBoxes
Retail
Option Value =1
Contractor
Option Value = 2
Dealer
Option Value =3
-----------------------------------------------------------------------
Products Table
FieldName DataType Caption Name
ProductID = AutoNumber
ProductName = Text
1 = Currency Retail
2 = Currency Contractor
3 = Currency Dealer
----------------------------------------------------------------------
Orders_SubForm.Form Code
Private Sub ProductID_AfterUpdate()
On Error GoTo Err_ProductID_AfterUpdate
Dim strFilter As String
strFilter = "ProductID = " & Me!ProductID
(Look up product's unit price and assign it to UnitPrice control.)
Me!UnitPrice = DLookup("[1]", "Products", strFilter)
Exit_ProductID_AfterUpdate:
Exit Sub
Err_ProductID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ProductID_AfterUpdate
End Sub
------------------------------------------------------------------
I replace the number 1 with 2
I get the Contractor Price
I replace the number 1 with 3
I get the Dealer Price
Can this be accomplished with Code ?
Any Help or other methods
Ms Access 2003
Thanks in Advance
Thomas