Solved

Change Enter Parameter dialog box title in MS Access 2010?

Posted on 2011-09-09
15
570 Views
Last Modified: 2012-05-12
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!

0
Comment
Question by:rinkydink
  • 7
  • 4
  • 3
  • +1
15 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 36510604
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.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36511795
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()

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36511936
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
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 26

Expert Comment

by:Nick67
ID: 36512041
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.
0
 
LVL 1

Author Comment

by:rinkydink
ID: 36512972
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!
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 36513086
No, no!

You build the function in a VBA code Module

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


and then you create a query thart uses = FakePrompt() as a criteria
Attached is a sample
FakePrompt.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36514739
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
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36515205
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
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36516560
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

0
 
LVL 1

Author Comment

by:rinkydink
ID: 36529129
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.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36530403
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.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36530426
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!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36530608
Well then a congratulation is in order!

Well Done!

;-)

Jeff
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36530753
Thanks man!
0
 
LVL 1

Author Comment

by:rinkydink
ID: 36533404
No prob, thanks for the solution and congrats on the new rank!

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question