dlookup problem

D

David W

Hi, first submission to the group. I am having trouble with a dlookup function and I was hoping somebody may know how to get around it. Briefly I have a form into which the user enters a series of numbers which are then averaged and this is then compared to values held in a table using a dlookup to obtain the corresponding value. The problem is that the dlookup appears not to calculate correctly so somehow I need to delay the dlookup function/calc until all the values have been entered and the average has been established. Any ideas?

Please reply to group as I'm unable to receive emails. Many thanks.
 
S

SJ

You'll probably want the Dlookup in its own function, call the function each time in the Exit or After update event on each text box. In the function, before calling the Dlookup, check that all the text boxes contain a value using isnull() or <> ""...

get the idea?



Hi, first submission to the group. I am having trouble with a dlookup function and I was hoping somebody may know how to get around it. Briefly I have a form into which the user enters a series of numbers which are then averaged and this is then compared to values held in a table using a dlookup to obtain the corresponding value. The problem is that the dlookup appears not to calculate correctly so somehow I need to delay the dlookup function/calc until all the values have been entered and the average has been established. Any ideas?

Please reply to group as I'm unable to receive emails. Many thanks.
 
D

David W

That's great, thanks. Now would you know if it is possible to run a dlookup in a report? I can get this to work in a form but can't seem to get this to work in a report.
You'll probably want the Dlookup in its own function, call the function each time in the Exit or After update event on each text box. In the function, before calling the Dlookup, check that all the text boxes contain a value using isnull() or <> ""...

get the idea?



Hi, first submission to the group. I am having trouble with a dlookup function and I was hoping somebody may know how to get around it. Briefly I have a form into which the user enters a series of numbers which are then averaged and this is then compared to values held in a table using a dlookup to obtain the corresponding value. The problem is that the dlookup appears not to calculate correctly so somehow I need to delay the dlookup function/calc until all the values have been entered and the average has been established. Any ideas?

Please reply to group as I'm unable to receive emails. Many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top