E
eye59
I am new to VBA and I am trying to write a function for a Commission form.
The form has 9 controls. 8 are a combination of combo boxes and dollars
amounts. The user input determines what Commission % should be used to
calculate the commission. I am trying to build a function that will
generate the commission rate based on the user input. Do I have to have a
commission rate table or can I do a series of If..Then...Else statements in a
function using say a variable dCommRate. and give dCommRate a value based on
the other parameters chosen in the If then... I tryed a Select ...Case but
that seems to only work in a sub procedure? and it is my understanding that
sub procedures cannot return values. After the dCommRate variable is
determined I then need to multiply the dCommRate by the Sale and populate the
information in the underlying data table.
Is this doable?
Thanks
The form has 9 controls. 8 are a combination of combo boxes and dollars
amounts. The user input determines what Commission % should be used to
calculate the commission. I am trying to build a function that will
generate the commission rate based on the user input. Do I have to have a
commission rate table or can I do a series of If..Then...Else statements in a
function using say a variable dCommRate. and give dCommRate a value based on
the other parameters chosen in the If then... I tryed a Select ...Case but
that seems to only work in a sub procedure? and it is my understanding that
sub procedures cannot return values. After the dCommRate variable is
determined I then need to multiply the dCommRate by the Sale and populate the
information in the underlying data table.
Is this doable?
Thanks