V
Vic
What did I do wrong.
How to start. I've have a form that a user puts in mileage information.
Then I created a table for different mileage rate.
On the main form I have a field called LdMilRteMT. This is the table
tbl_LoadInfo and is defined as a lookup field to table tbl_MileageRate. This
field is a popup and the bound column is 1 which is the ID in the table
called tbl_MileageRate Rate that holds the different rate. The field showing
is the actual mileage rate that is selected. Let's say $.40 per miles.
Then I went through the help menu and created a text field to actually show
the payout for the mileage. In that text field I put the in the control
source the following:
=[LdMilRteMT]*[LdMtMiles]
This works great except for one problem. It doesn't calculate correctly.
Lets say you have 130 miles * $.40. The total should be $52.00. The total
I'm getting is $130.00.
I found what it's doing. It's taking the record ID or autonum field and
multiplying that times the miles. It's not using the mileage rate displayed
on the screen.
Oh the table that holds the mileage information is called tbl_MileageRate.
The field that actually holds the mileage rate information in that table is
called of course MileageRate.
Any idea's where I went wrong. I really would just prefer to store the
results in another field but from what I've read I guess that's a bad idea.
I received this response
Easy!
Without qualification Access will use the value of your list box or combo
box that you have correctly identified as being the rate id. (You specified
this when you defined the bound column as being 1.)
I assume the actual rate is in column 2 and I further assume it's numeric so
all you have to do tell Access to use the value in the second column - BUT
BEWARE, internally these columns are numbered relative to zero. The
expression you want is therefore:
=[LdMilRteMT].col(1)*[LdMtMiles]
But now this happens
I pasted the following =[LdMilRteMT].col(1)*[LdMtMiles] in the control box
field. As soon as I did that the field changes to #Name?. Also, when I put
that code in, it put the following in the field .[col](1).
I'm not quite sure where to go from here. HELP.
Anyone have any suggestions?
Thanks
How to start. I've have a form that a user puts in mileage information.
Then I created a table for different mileage rate.
On the main form I have a field called LdMilRteMT. This is the table
tbl_LoadInfo and is defined as a lookup field to table tbl_MileageRate. This
field is a popup and the bound column is 1 which is the ID in the table
called tbl_MileageRate Rate that holds the different rate. The field showing
is the actual mileage rate that is selected. Let's say $.40 per miles.
Then I went through the help menu and created a text field to actually show
the payout for the mileage. In that text field I put the in the control
source the following:
=[LdMilRteMT]*[LdMtMiles]
This works great except for one problem. It doesn't calculate correctly.
Lets say you have 130 miles * $.40. The total should be $52.00. The total
I'm getting is $130.00.
I found what it's doing. It's taking the record ID or autonum field and
multiplying that times the miles. It's not using the mileage rate displayed
on the screen.
Oh the table that holds the mileage information is called tbl_MileageRate.
The field that actually holds the mileage rate information in that table is
called of course MileageRate.
Any idea's where I went wrong. I really would just prefer to store the
results in another field but from what I've read I guess that's a bad idea.
I received this response
Easy!
Without qualification Access will use the value of your list box or combo
box that you have correctly identified as being the rate id. (You specified
this when you defined the bound column as being 1.)
I assume the actual rate is in column 2 and I further assume it's numeric so
all you have to do tell Access to use the value in the second column - BUT
BEWARE, internally these columns are numbered relative to zero. The
expression you want is therefore:
=[LdMilRteMT].col(1)*[LdMtMiles]
But now this happens
I pasted the following =[LdMilRteMT].col(1)*[LdMtMiles] in the control box
field. As soon as I did that the field changes to #Name?. Also, when I put
that code in, it put the following in the field .[col](1).
I'm not quite sure where to go from here. HELP.
Anyone have any suggestions?
Thanks