Solved

Change Enter Parameter dialog box title in MS Access 2010?

Posted on 2011-09-09
15
548 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now