Link to home
Start Free TrialLog in
Avatar of rinkydink
rinkydink

asked on

Change Enter Parameter dialog box title in MS Access 2010?

Hi - Is there a way to change the default Enter Parameter dialog box title in MS Access 2010? Not the text that appears on the box like "Enter your name" or something but the actual title of the box ... like you can change a msgbox title in a VB, C app,  etc.

Thanks!

Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

No.

If you don't want to see it then build a form for users to enter the required values and use the form reference instead of the parameter field.
Ditto what @peter57r said.
But...
Queries can take functions as parameters so...

Function FakePrompt()
FakePrompt = CLng(InputBox("hey", "you", "1"))
'where I used this was in a Long field
'inputboxes return strings--so coerce yours as applicable
'I needed to coerce to long, hence Clng() wrapping the inputbox
End Function


Then instead of the [Enter your parameter]
put
=FakePrompt()

Yes, why force your users to type in anything...?

Suppose a user spells the name wrong...?

Use the standard technique of building a form with a combobox where the user can easily "select"  a name from a combobox.

Then your Query criteria would be something like this instead:

    WHERE SomeName=Forms!YourForm!YourCombobox

There are half a dozen other ways to do things like this, as well.

Just an FYI
Don't get me wrong.
A a parameter form is a very happy thing
but...
<Is there a way to change the default Enter Parameter dialog box title>
NO.
Can you use a ligtweight function to substitute an InputBox (which you can change the title for)
YES.
Would I do that?
I can't picture a scenario for me where it makes sense--but it can be done.
Avatar of rinkydink
rinkydink

ASKER

Not being a db genius by any means......I need to write the function in vba and then call the query?

Does the query need to be written in vba as well versus a saved query?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
rinkydink,

You don't think making a standard form with a combobox (the standard way this is done) is even worth investigating?

I applaud Nick for his stellar code, but even he advised against this originally.

We have all harkend back to Pete's original post, ...which you never replied to...

And again, ...using a form with a combobox is the standard way of doing this...

Jeff
And I do concur with both @peter57r and @boag2000 that creating or using a form and using a reference of =Forms!SomeForm!SomeControl is a better way to pass a parameter to a query.
But I always hesitate to say something is impossible.
And it is handy to know how to create a public function to pass a value that you couldn't otherwise use as a query parameter, like a global variable for example.

What I provided was a curiosity, not a production solution.
It would work, but it really isn't how a polished app would implement your requirements
Nick,

Well said...

... and in all fairness, I think whatever solution you post should be noted and/or accepted.

Sometime the thought process involved in doing things in a different way is the most important thing.

There are always different ways to do the same thing.


And we all know, that in most cases there is no clear-cut Right or Wrong solution.

In addition, we all must acknowledge (myself especially) that there are situations where "The Standard approach" is simply not applicable, or not a viable option (for whatever reason), in these cases, an alternate approach is needed.

Finally, ...Who am I to say what the solution should be?
LOL

My goal was just to remind the OP of the original suggestion by Pete.

So as long as both approaches are noted, the ultimate solution is up to the OP.

Jeff

Thanks guys!

I have used a form to pass a parameter via a control before and so I agree it is the most common and most practical way to do this normally, in this case, I had to dump an Excel file with hundreds of names into a temporary table so I could run a quick query on them to return their manager's name when needed and it is mostly only used by me then it will be deleted so the function option works better for me in this case versus adding hundreds of names to a combo box.

I was not aware of how to pass a function as a parameter so I learned something new and I appreciate that.
Good!

I am glad that it was useful and you learned something new.
There are some things the query editor just doesn't like.
It's handy to know that, if you can write them up as a function, that you can use anything in the query editor.
As a personal side note, thanks for the points.
They were the points that moved me in rank from Guru to Wizard in MS Access!
Well then a congratulation is in order!

Well Done!

;-)

Jeff
Thanks man!
No prob, thanks for the solution and congrats on the new rank!