I need a little help with a form and subform

G

Guest

I'm building a database for estimating. I have a form which has a combo box
to select the customer from. In the customer table there is a checkbox which
indicates whether or not they receive a discount. On the subform is where the
the parts and labor are entered. What I want to do is have the parts and
labor show at the discounted price or list price depending on which customer
is selected. I know this isn't very hard but not having designed a database
in a while I have grown rusty.
 
A

Arvin Meyer [MVP]

I would put 3 or 4 columns in the combo to pick the part, depending upon
whether there is a discounted price or variable discounted price (%) stored
in the parts table. Lets say the combo looks like:

Col1 Col2 Col3
PartID Name Price

Column widths would be:
0";1.5";0"

And the AfterUpdate evnt of the combo might look something like:

Sub cboParts_AfterUpdate()
If Me.Parent.chkDiscount = True Then
Me.txtPrice = Me.cboParts.Column(2) - (Me.cboParts.Column(2)*.15)
Else
Me.txtPrice = Me.cboParts.Column(2)
End If

Me.txtExtendedPrice = Me.txtPrice * Qty
End Sub
 
G

Guest

Thank you for the help. Below is what I have thus far, but it doesn't seem to
be working.


Private Sub Description_AfterUpdate()
If Me.Parent.Location.Column(5) = True Then
Me.UnitPrice = Me.Description.Column(6) + (Me.Description.Column(6)
* 0.5)
Else
Me.UnitPrice = Me.Description.Column(6) + (Me.Description.Column(6)
* 1)
End If

Me.Total = Me.UnitPrice * Qty
End Sub


Any ideas?
 
G

Guest

Arvin, thank you and I almost had forgotten that the column count started at
zero. The code I posted was copied and posted from the VBA editor. I still
can't get it to work though. Is it possible that I need something tied into
an event for the Unit Price? Thank you in advance...
 

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