[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change Enter Parameter dialog box title in MS Access 2010?

Posted on 2011-09-09
15
Medium Priority
?
647 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

873 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