Problem getting parameters from a form.

samehkh

Registered User.
Local time
Yesterday, 22:58
Joined
Aug 11, 2003
Messages
63
Hi

I ve been doing access programming since 1997, I've always used queries that read parameters from a form's text box or combobox or whatever, and this always worked for me no problem until, I started a new job and need to develop a small application to replace the paperwork I have to do.
I was surprised that i am having problems doing that, the queries almost always did not get any results. I cut the parameter expression and pasted it as a column in the query to see its value at runtime, I found garbage characters, mainly a square!!
The queries only work when I convert the parameter value coming from the control e.g Forms![Orders]![OrderID] or whatever the exact syntax is, in a Clng () conversion, i.e. I had to make it look like this Clng (Forms![Orders]![OrderID]). This is happening to me for the first time in several years of Access programming. I am not happy with the way I worked around the problem because something is definitely going wrong and I shouldnt be patching the problem like this.
Can anybody give me a clue?
 
OK, I am guessing here, but it sounds like you are running into a Unicode issue.
Are you using any kind of special keyboard or language?
 
No it is all english.
 
When you see these "garbage" characters, are they 2 for one (like you put in 12 and you get 4 characters)?
 
I actually changed the whole design now to read the parameter from a function GetDocumentNo() rather than a control on the form. At sometime i still had to enclose the function call in a Clng() but now seems to be working. Thats crazy. Sorry I lost track of the problem now as I changed the design, but will pst later if I could regenerate the problem.
 

Users who are viewing this thread

Back
Top Bottom