prompt for values based on combo box selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a form for users to input all savings obtained. Depending on the
type of savings obtained - which can be selected via a list box, I need the
user to input price, quantity, cost of capital, etc. From the values input,
I want to calculate the savings and save the new record to a table. Any
information you think may help would be appreciated ... I am at a stand still
right now.

Thanks.
 
I created a form for users to input all savings obtained. Depending on the
type of savings obtained - which can be selected via a list box, I need the
user to input price, quantity, cost of capital, etc. From the values input,
I want to calculate the savings and save the new record to a table. Any
information you think may help would be appreciated ... I am at a stand still
right now.

Thanks.

I guess it's not clear what you are asking.

What is the structure of your table? Ordinarily you would store the
actual entered data (input price, quantity, etc.) and NOT store the
calculated savings - it can be recalculated whenever needed using a
query, or a control on a form or report.

Just what do you want the combo/listbox to DO?


John W. Vinson[MVP]
 
My Table holds data based on the type of savings (EX: discount; fee
avoidance; free shipping) and the associated dollar amount of savings. The
combo box allows the user to select the savings type (discount; fee
avoidance; free shipping). Depending on what type of savings the user
obtains, the dollar amount is calculated differently. Therefore I was trying
to come up with a way to prompt the user to enter the correct parameters
based on the savings type and then save the type and dollar amount as a new
record ... I hope this is more clear.

Thanks.
 
My Table holds data based on the type of savings (EX: discount; fee
avoidance; free shipping) and the associated dollar amount of savings. The
combo box allows the user to select the savings type (discount; fee
avoidance; free shipping). Depending on what type of savings the user
obtains, the dollar amount is calculated differently. Therefore I was trying
to come up with a way to prompt the user to enter the correct parameters
based on the savings type and then save the type and dollar amount as a new
record ... I hope this is more clear.

A little bit, but not much.

Where in your table or form does the user "enter the correct
parameters"? How is the calculation done?

I'm GUESSING that you'll want some VBA code in the AfterUpdate event
of the combo, such as (wild guessing here):

Private Sub cboSavingsType_AfterUpdate()
Select Case Me!cboSavingsType
Case "Discount"
MsgBox "Some Appropriate Message For Discounts"
Case "Fee Avoidance"
MsgBox "...
...
Case Else
MsgBox "Ooops, unaccounted for savings type!"
End Select
End Sub

If the combo is bound to the savings type field, its value will be
saved to a new record by default - that's how forms WORK. Since I have
no idea how the calculated dollar amount IS calculated I cannot
advise, other than to say calculate it and store it in a bound textbox
on the form.

John W. Vinson[MVP]
 
Back
Top