My issue is a little evil. I'm trying to create a report that is a balance sheet of the company's machine sales. Each machine has an install and warranty amount allotted to it. All manufacturers except one have hardwired amounts tied to the machine model. Therefore, my code uses a DLookup to pull up the correct amount if the manufacturer matches, and plinks it into a bound textbox. This reports perfectly.
Now here's my problem. The red-headed stepchild manufacturer. Let's call them Satan, Inc. Satan, Inc's install and warranty cost is a multiplier of the customer purchase price. So right now I do the same thing as above, but lookup the % multiplier, and list it in the textbox. So it uses the same field as above, but just lists .15. I would like it to pull from the customer purchase price, multiply it by "Install%", and plink it into the abovementoined bound textbox. Then everyone would be happy.
I already test the company name.
Right now it fills in a % if the company is Satan, Inc, and a currency amount if it is any other manufacturer. My question is regarding the proper syntax of:
me.txtinstlcost = dlookup(purchase price) * dlookup(install %)
Can I just multiply two Dlookups? The problem with making it an AfterUpdate of Machine Model is that purchase price isn't determined until later on in the form. It's not hardcoded into a table because it is a function of base price and options.
I'm probably looking for a way to use an AfterUpdate of PurchasePrice. It's some kind of VB code that I'm not familiar enough with to use.
Can you multipley 2 X 2? Of course you can multiply two dlookups. All the multiplication operator sees are the two return values from dlookup... Just make sure you are not going to multiply anything by null.