By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,668 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,668 IT Pros & Developers. It's quick & easy.

Parameter query from DAP

P: 6
I've a MS Access 2000 db on Windows XP with around 25 000 records. A textfield contains the persons whoole name. It can be written: First FirstName, Second FirstName, MiddleName, LastName or MiddleName LastName Second FirstName First FirstName or in which order you can imagine. I try to make a parameter query from a Data Access Page where users can enter the name "Billy" or what name they want and like in Excel get an answere if "Billy" exist anywhere in the namefield. I tried with everything I can think of but no result. Can anyone help me or must it be programming to solv it? I am no good in that field: I once learned RPG II on IBM but it is decades since!
May 28 '07 #1
Share this Question
Share on Google+
6 Replies

nico5038
Expert 2.5K+
P: 3,072
There's an easy way for this.
Right-click the name field and enter in the popup window:
*billy* followed by enter to have a LIKE match.
All wildcharacters can be used in that popup selectionfield.

For a query use in the criteria field:

LIKE * & [forms]![formname]![fieldname] & *

but the right-click is a lot shorter....
Does that solve your problem ?

Nic;o)
May 28 '07 #2

P: 6
There's an easy way for this.
Right-click the name field and enter in the popup window:
*billy* followed by enter to have a LIKE match.
All wildcharacters can be used in that popup selectionfield.

For a query use in the criteria field:

LIKE * & [forms]![formname]![fieldname] & *

but the right-click is a lot shorter....
Does that solve your problem ?

Nic;o)
Tanks! It works!! Whouh!!
I´m so glad for your help.
Mybe you are the one who can tell me why I can't query my db to recieve e specific recordnumber from Data Access Page when I write a record number 1853 and above 1852 is OK but no higher number. Query the db give the results 1852 and all other starting with the same number but I would like to hav that specific record from DAP 1853 or 12345 or whatever to show the user the whole record content.
I must use different wildcards in db and in DAP. They look like this
WHERE (((Id) Like [Ange ID-nr] & "*")); for db and
WHERE (((Id) Like [Ange ID-nr] & "%")); for DAP
Thanks from Sören in Sweden
May 28 '07 #3

nico5038
Expert 2.5K+
P: 3,072
Hi Sören

Always best to post separate discussions for separate questions.
In this case I suspect that your key has been defined as a text datatype in the table.
Best to have it defined numeric so the selection and sorting is "logically".
The other solution would be to append spaces to each number making the string always the maximum length. This will sort OK, but selection is also needing the appended spaces...

Nic;o)
(From The Netherlands :-)
May 28 '07 #4

P: 6
Hi Nic!
I withdraw my second Q and make a new on but I can tell ou about it that the field is numeric
/Sören

Hi Sören

Always best to post separate discussions for separate questions.
In this case I suspect that your key has been defined as a text datatype in the table.
Best to have it defined numeric so the selection and sorting is "logically".
The other solution would be to append spaces to each number making the string always the maximum length. This will sort OK, but selection is also needing the appended spaces...

Nic;o)
(From The Netherlands :-)
May 30 '07 #5

nico5038
Expert 2.5K+
P: 3,072
The % wildcard will work in Access too, so you can use just one wild character in both cases :-)

The "LIKE" can be a problem when the field is numeric. A work-around can be to use:

WHERE Fieldname + " " LIKE ....

Thus you force the field to be seen as a text field...

Nic;o)
May 30 '07 #6

P: 6
Hi Nic
I tried with your proposal but it still wont work with number 1853 and higher!!!
/Sören

The % wildcard will work in Access too, so you can use just one wild character in both cases :-)

The "LIKE" can be a problem when the field is numeric. A work-around can be to use:

WHERE Fieldname + " " LIKE ....

Thus you force the field to be seen as a text field...

Nic;o)
May 31 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.