A family of Microsoft relational database management systems designed for ease of use.
The basic issue is you have some code that works just fine in one application. That same code does not work in a new application.
And you posted two different syntax examples.
I assume you are asking why the help has such a DIFFERENT code sample then what you have (or at least I assume you are doing as such, else why post two VERY different examples of code?)
So the reason why the help file has such a DIFFERENT syntax from what you posted is there are two ways of using a function (as I explained above).
So my explain here is WHY YOUR example looks SO VERY different then the help example. And if you are not confused by the help example then why are you quoting and posting that example that you note is not working for you and of no help then?
My simple suggest is really just that, a simple suggestion.
So I am stating I think it best you continue using the same code and same syntax as the code that you stated works so well in your first case.
Now that we cleared up why your two posted example are so different to the reading public here (after all, people are here to learn), then the next issue remains:
Your first example code should work in the other application. We just don't know why and that of course is your basic question.
The ONLY reason I can think of why this code does not work in the new application is that your form name(s) are different, or as noted there is some different nesting of the forms due to (possible) use of a navigation form.
In other words, since you have in the past had success with the particular format and particular syntax you posted, then I think you should continue to use that same base format and tweak that code to work in the new application. (don’t use the help example format you posted since as noted it uses a DIFFERENT format for the function parameters).
In other words, I am in effect agreeing with you that it makes LITTLE sense to adopt the help file syntax (that YOU quoted) and that YOU yourself claim is confusing and not helping you.
So I 100% agree – it makes ZERO sense to use the DIFFERENT syntax and DIFFERENT format THAT YOU outlined and posted from the help file.
In other words, CONTINUE using your existing syntax as opposed to the help file syntax which we BOTH agree is not only confusing, but is in fact not required here!
The simple and basic advice here is to continue using, and stick to the syntax and format that you had the most success with in the past.
As noted, since your given first example code does not work in the second example, then something in regards to the form name must be different. Perhaps there is some other issue we simple have not yet considered here such as nesting or navigation forms. The code should work, but since it does not then something must be different in the second application.
So the basic lesson and first advice from the "get go" is I much think it is best to stick to using your first syntax that you at least had some success in the past.
It is possible I am not grasping why you posted two very different syntax here if you did not want a explain as to why the two syntaxes are so different? Perhaps you DO want to adopt the second syntax format you posted, but you have freely admitted that such a syntax from the help is of little use to you. And my point is you don't need to adopt that syntax to fix your problem anyway.
If the form names are exactly the same in both applications, and you double checked that the syntax of your code is also 100% the same (no type-o's), then additional trouble shooting will be required.
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada