Enter parameter value (1 Viewer)

hunter_vs

Registered User.
Local time
Today, 02:54
Joined
Jan 15, 2009
Messages
11
hI I have a parameter value box.... which is done via the design wizard in design views of queries..

when the parameter box appears - how can i code it so that if a textual character is entered into the parameter box, a messagebox shows (at the moment, it shows a standard ms access message saying "the expression is typed in correctly... etc" the reason for this is because the parameter box is to be used to numbers, such as ID's etc.


many thanks.
 

namliam

The Mailman - AWF VIP
Local time
Today, 11:54
Joined
Aug 11, 2003
Messages
11,695
You cannot parameter queries are extreemly limited...

Do a search on the forum for "Search by form" in the sample section... Should give you some samples...

Come back if you have more questions.

Good luck !
 

hunter_vs

Registered User.
Local time
Today, 02:54
Joined
Jan 15, 2009
Messages
11
hi - thanks for your help!.
is there no way round whatso ever, even in the SQL, so that only numerical values can be done..
also, at the moment, the parameter value is lookint at the table for Client id number.. if the client id doesnt exsist, i get a runtime error.. is tehr any way around this - so taht if the client doesnt exsist, then show a meaningful messagebox?
thanks.
 

Brianwarnock

Retired
Local time
Today, 10:54
Joined
Jun 2, 2003
Messages
12,701
in SQL Parameters yourparam Long;
for example.
would give an error if text was entered, but I thought you wanted to customise the message.

If this is ok in design grid go to query then parameters and a dropdown gives the options.

Brian
 

hunter_vs

Registered User.
Local time
Today, 02:54
Joined
Jan 15, 2009
Messages
11
[/IMG]

hi, im not sure if i expained myself clearly.. so i let the pictures to the talking...
above are the screenshots of the parameters.....

if i was to enter a client that didnt exsist... the second screenshot is the error that i get!... is there a way around that, so that if a client id is entered, and the client doesnt exsist... some sort of meaninful message comes up!. instead of taht runtime error.
thanks.
 

Brianwarnock

Retired
Local time
Today, 10:54
Joined
Jun 2, 2003
Messages
12,701
We seem to have a moving target, but anyway its back to Namliam's suggestion of using a Form , a dropdown list based on the table would mean only existing IDs could be selected

Brian
 

hunter_vs

Registered User.
Local time
Today, 02:54
Joined
Jan 15, 2009
Messages
11
ok, if you suggest i use a dropdown, which shows all the client ID'S....
how can i have it so that, when a client id is selected, that client ID;s report is shown... because at the moment, with the parameter box, when the clients id is selected, the report for that id opens up!..
thanks for your help so far!
 

jardiamj

Registered User.
Local time
Today, 02:54
Joined
Apr 15, 2009
Messages
59
Look for "Search by Form" as Namliam suggested!!
 

namliam

The Mailman - AWF VIP
Local time
Today, 11:54
Joined
Aug 11, 2003
Messages
11,695
but anyway its back to Namliam's suggestion of using a Form

Look for "Search by Form" as Namliam suggested!!

hi - thanks for your help!.

Let me help you some more:
1) Click "search"

2) Click "Advanced search"

3) In the "search by keyword" box type: "Search by form" (without the quotes)

4) In the "Search in forums" section select only "Microsoft access reference"

5) click on the "Search now" button at the bottom

You will find examples like:
- Search Form Example
- Advanced Search Forms

These two will show you what to do, how to do it.

If you have specific questions, run into trouble, etc... post back here

Good luck
 

Users who are viewing this thread

Top Bottom