Okay! I have tried all day to come up with the answer to my dilemma and simply have hit my capacity. I am sure this will be a cake walk for someone out there.
I have a table with status field indicating whether the person covered has Single (S), Family (F), etc. coverage. There is another table with the rates. The individual's record connects to the rates through a Location Code and a Medical Rate Code. However, there are still four rates to choose from based on their status field (Single, Family, etc.).
What I need to do is for the one field in the Benefits table to select which field in the Medical Rates table in order to select the distinct rate for that employee. Here is my sad attempt:
If ([Benefits]![EE Covg]="S") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![EE]
ElseIf ([Benefits]![EE Covg]="F") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![Fam]
ElseIf ([Benefits]![EE Covg]="1") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![EE+1]
ElseIf ([Benefits]![EE Covg]="2") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![EE/Kids]
ElseIf ([Benefits]![EE Covg]="W") Then
[Benefits]![Med Mon Rate]="0"
End If
I get "Syntax Error" everytime I try this one.
Is this the right format to use? Should I use Select Case? Also, do I simply do an Update Query and add the information to a separate field in the Benefits table or can I run a query that will simply contain the selected rate within it?
Thanks for anyone who can help on this.
Brandon
I have a table with status field indicating whether the person covered has Single (S), Family (F), etc. coverage. There is another table with the rates. The individual's record connects to the rates through a Location Code and a Medical Rate Code. However, there are still four rates to choose from based on their status field (Single, Family, etc.).
What I need to do is for the one field in the Benefits table to select which field in the Medical Rates table in order to select the distinct rate for that employee. Here is my sad attempt:
If ([Benefits]![EE Covg]="S") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![EE]
ElseIf ([Benefits]![EE Covg]="F") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![Fam]
ElseIf ([Benefits]![EE Covg]="1") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![EE+1]
ElseIf ([Benefits]![EE Covg]="2") Then
[Benefits]![Med Mon Rate]= [Medical Rates]![EE/Kids]
ElseIf ([Benefits]![EE Covg]="W") Then
[Benefits]![Med Mon Rate]="0"
End If
I get "Syntax Error" everytime I try this one.
Is this the right format to use? Should I use Select Case? Also, do I simply do an Update Query and add the information to a separate field in the Benefits table or can I run a query that will simply contain the selected rate within it?
Thanks for anyone who can help on this.
Brandon