Mistery Parameter for Function

George Too

Registered User.
Local time
Today, 06:45
Joined
Aug 12, 2002
Messages
198
Hello All,
I have two bound text boxes that are using the same function to convert their decimal source data into fractions. The function works well on one of the boxes but generates an error on the second box and that is because the number "20520" is being passed as the parameter (the function does not take non-decimals). I do not know where this number is coming from. I have three forms that use this function and all three are passing the same number to the function on the same text box. How can I troubleshoot to find exactly which control is generating the number "20520"?

Thanks
 
Set a breakpoint at the start of the function and F8 through it, checking at each point your values.
 
Can you use Screen.ActiveControl for anything?
 
I have set a breakpoint in the function, that is how I found that my value of "5.25" is being passed to the function as "20520".

I have used the Screen.ActiveControl as suggested by RuralGuy and it show that the control where I am using the function is the one passing the value (that is expected).

My headache lies on why "5.25" is being passed as "20520" by the text box. I have this "=fGetFrac([Width])" as the control source for the text box in question. Am I doing something wrong?

Thanks.
 
Do you have a field named "Width"? If so then you should know that it shares a name with a reserved word. I would suggest changing the field name.
 
I believe that fixed it. I have been using that name for the field for a while and had not come across any problems before so I never thought of that.

Thanks for the time
 
Excellent! Thanks for posting back with your success.
 

Users who are viewing this thread

Back
Top Bottom