Noob needs help

gessie

New member
Local time
Today, 22:41
Joined
May 27, 2007
Messages
4
I'm a complete newbie to MS Access, and I'm working on my 2nd database.

Just a small and probably retarded issue: I have a table which includes a field, which contains four numbers. In a query I want my users to be able to enter a number, like 6, and the three numbers after that will have to be wildcards.

Example: The field has these entries:
8243
8184
6423

When the user enters "8", it should show the first two records. When the user enters "6", it should show the third record.

How can I accomplish this?
 
Thanks for the reply.

I believe you misunderstood: I'm really new to Access, I don't have a clue what you mean by "Like". Also, I tried using Help before I created this topic, no result.

I've messed around with a few things I found on a quick Google search, perhaps I could use [?] followed by a * in some way?
 
In the criteria of the query design grid you can enter expressions to pull the information you want. Like is an expression that returns records that contain values "Like" something. An example is Like "8*" for all records beginning with 8. Check the help file for Like to see all the examples.
 
This didn't answer my question, but thank you anyway.
 
You want to add a parameter command to your query.

Go to your query in design view, and go to the field that you want to search on.

In the section named 'Criteria', type: []&"*"

This will cause the query to prompt the user with a popup window to type the number. The [] tells Access to prompt the user to enter the criteria, and the "*" indicates that there can be any text following the indicated criteria.

If you want to instruct your users with something so they know what to do, add text inside the square brackets, and it will show up as the instruction. For instance:

[Please type the first character]&"*"

Will prompt the user with the words, 'Please type the first character'.

Hope that helps!
 
Last edited:
Thanks a lot, that's exactly what I was looking for.

However, it shows an error (translated from the Dutch MS Access): This expression is typed incorrectly or it is too complex for evaluation.

I'm not sure if it matters, but the field type is "Number" and the other settings are default.

(Edited)

Nevermind, I've found the (extremely simple) solution. I simply entered Like []&"*" in the criteria field.

Sorry about wasting your time.
 
Last edited:
Oops, sorry I forgot that part of the text, lol. Good for you for figuring it out.
 

Users who are viewing this thread

Back
Top Bottom