Using 'like' on a user prompt

I want to prompt the user for a value to use to filter a form. Here is my
command with the WhereCondition:

docmd.OpenForm "test", acNormal, , "LastName=[Enter a Last Name]"

I want to use the WhereCondition as a "LIKE" criteria. Variations on the
WhereCondition itself that I've tried include various combinations of 

LastName LIKE %...%
LastName LIKE *...*
LastName LIKE [%...%]
LastName LIKE [*...*]

You get the idea...

No luck so far. Any thoughts?

0
RicDon
5/27/2010 9:52:50 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
616 Views

Similar Articles

[PageSpeed] 42

On Thu, 27 May 2010 21:52:50 GMT, "RicDon" <u60397@uwe> wrote:

>I want to prompt the user for a value to use to filter a form. Here is my
>command with the WhereCondition:
>
>docmd.OpenForm "test", acNormal, , "LastName=[Enter a Last Name]"
>
>I want to use the WhereCondition as a "LIKE" criteria. Variations on the
>WhereCondition itself that I've tried include various combinations of 
>
>LastName LIKE %...%
>LastName LIKE *...*
>LastName LIKE [%...%]
>LastName LIKE [*...*]
>
>You get the idea...
>
>No luck so far. Any thoughts?

LastName LIKE "*" & [Enter a last name, or part of one:] & "*"
-- 

             John W. Vinson [MVP]
0
John
5/28/2010 1:09:03 AM
"RicDon" <u60397@uwe> wrote in message news:a8a6128a88ad8@uwe...
>I want to prompt the user for a value to use to filter a form. Here is my
> command with the WhereCondition:
> 
> docmd.OpenForm "test", acNormal, , "LastName=[Enter a Last Name]"
> 
> I want to use the WhereCondition as a "LIKE" criteria. Variations on the
> WhereCondition itself that I've tried include various combinations of 
> 
> LastName LIKE %...%
> LastName LIKE *...*
> LastName LIKE [%...%]
> LastName LIKE [*...*]
> 
> You get the idea...
> 
> No luck so far. Any thoughts?


Try:
    
    Docmd.OpenForm "test", acNormal, _
        WhereCondition:="LastName Like '*' & [Enter a Last Name] & '*'"

-- 
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

0
Dirk
5/28/2010 1:14:01 AM
Reply:

Similar Artilces:

Create new Exchange Mailbox without creating a new AD-User
I'm running Win2003SBS SP1 with Exchange2003 SP2. I would like to create funtional exchange-mailboxes (info@..., service@...) without creating a new AD-User as owner of these mailboxes. Owner should be an already existing AD-User. Is this possible and how could this be done. Thanks. Andreas Andreas Lauer IT Service wrote: > I'm running Win2003SBS SP1 with Exchange2003 SP2. > I would like to create funtional exchange-mailboxes (info@..., service@...) > without creating a new AD-User as owner of these mailboxes. Owner should be > an already existing AD-User. > Is thi...

Access 2007 User Lock Problem
We use Access for our mailing list and just today we encountered a problem. Every time we make a change in design view (no one else is in of course) and save our new change, once everyone else gets in, our form wont open for them. Only The computer who made the change will. Example: Computer A Makes change, closes. Computer B Cannot open form, only Computer A. Computer B now makes a change Computer A Now cannot open form, only computer B. The most recent computer to make a change in the database on our server now is the only one that can open the form. Any help would...

I would like the tabs in Excel to be listed vertically on left.
There's no option setting that will move the sheet tabs to the left. You can send suggestions to: mswish@microsoft.com Put "Excel" in the subject line, so your suggestion will be forwarded to the Excel product managers. Suzy wrote: -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Why is InnerException used
Hi! Some exception has further information in the Inner Exception property. For example the SmtpException has useful information in the InnerException that can be used Here is an example catch (SmtpException ex) { Exception inner = ex.InnerException; MessageBox.Show("Could not send message: " + inner.Message, "Problem sending message", MessageBoxButtons.OK, MessageBoxIcon.Error); } So my question is why is not the InnerException.Message information put into the SmtpException.Message ? ...

Using drop-down lists with keyboard
I am having trouble implementing drop-down lists in a way that is easy for a user who is using a keyboard rather than a mouse. Standard combo-box controls are great - a user can tab into the field, type the first few letters of the value they want, then tab on out to the next field in the form. Maybe 5% of the time an experienced user might need to actually drop-down the list to find the value they want. I want this same ability in a worksheet cell. The combobox form control supports this (with MatchEntry = fmMatchEntryComplete), but if I place a combobox on a cell, the user has to click o...

Using alias address
We use an exchange server at work for e-mail. I have set up an alias that I use for receiving mail but I wanted to use the alias for sending all the mail as well. I was told that it cannot be done in exchange but I can use a POP server. So I set up the alias to use the POP and made it my default account. But it still continues to use the exchange serever account on outgoing mail. Incoming mail is working fine for both the accounts. Isnt there a way I can use the alias to send the e-mail as well? I can change the outgoing accont/address for each message but by default it picks up the exc...

I need help to start using microsoft outlook to receive my mail .
I have tried before to set up my microsoft outlook for my mail with no success. MikeR wrote: || I have tried before to set up my microsoft outlook for my mail with || no success. And what has happened? Have you checked your mail settings with your ISP? Any error messages? Help us to help you. -- Interim Systems and Management Accounting Gordon Burgess-Parker Director www.gbpcomputing.co.uk I forgot how to get that info., but I think I did that before like - getting the pop & other info in there and still to no avail.. "Gordon" wrote: > MikeR wrote: > || I have ...

Need to import select Access data into Excel using two variables
I have a large amount of data in Access, more than Excel can manage. The data consists of many columns; has Col_1 as unique key 1,2,3,4,5,6,7,8 etc… and contains data that includes Col_2, Col_3, Col_4 etc…. It takes a combination of Col_2 and Col_3 to get the data I want. Col_2 has duplicate values and Col_3 makes the subset unique. One more thing… Col_3, Col_4 etc…may have blanks throughout the table and can’t be changed. I don’t own it. I want to be able to open Excel, type “Number from Col_2” into Col_A , “(Number fromCol_3) or (blank)”into Col_B and have the Col_4, Col_5 etc… d...

When using the Publisher Web Site Wizard I get an error that Publi
Can somebody help me please? When using the Publisher Web Site Wizard I get an error that Publisher cannot complete the action. I have run a Repair and Reinstallation and the Web Wizard still doesn't work. Has anyone seen this problem before. Sincerely, VanNimRodDius X ...

Automatic transfer of user inputted data between sheets
Hi, I have just started using excel and have made my first real spreadsheet with 12 separate sheets. I have managed to automatically transfer results between sheets but I want to go up a level. My idea is to allow the user to input a name in one sheet and for this data to be automatically recognised in a separate sheet and automatically updated. Example : sheet 1 is the result sheet sheet 2 contains 15 "heat results" allowing the user to input points that are automatically added together and displayed both in sheet 1 and sheet 2. Now the hard part: After the 15 he...

caonnt create user in crm snap-in
Hi, when I want to create a user in crm snap-in I get an error saying that I do not have the right privileges to run the user wizard. It happens just after selecting the user from the domain. I am logged on as domin administrator - that domain administrator who has installed the crm server shortly beforte and under which the services are running. Moreover I am not able to logon to the crm site with my administrator account. I just get an error from crm server. Has anybody an idea? Thanx a lot... P. Verify that all the services have started properly. If you can't get into the web ...

how do i create a repeating student certificate using excel
i have a database of my class and i want to make a repeating student certificate using excel is their any way to do this in a simple way ?? > i have a database of my class and i want to make a repeating student > certificate using excel I'd use MS-Word's mail merge feature. For details, look in Word's built-in Help for "mail merge." Design your form in a separate sheet. In the Cell where the Name goes Use Data Validation and choose list and reference the range for the names. You can select the first name and Print off the certificate then sel...

Using cell refs in Excel hyperlinks.
Is this possible? This would be so useful!! Piker It is always helpful to state which version of Excel you are using. Excel 2002...... Right-click on a cell and select "Hyperlink". Select from left "Place in this Document". From the list of worksheets pick the sheet and enter a cellref or choose named range and OK. Excel 97.............. Right-click on a cell and select "Edit Hyperlink". "Link to File or URL" browse to your workbook(file) and select>OK. "Named Location in File" browse to your sheet and enter a cellref or named ...

Handling HTML events using MFC/C++ #2
Hello guys! I have following situation: I created application and embedded Microsoft Web Browser ActiveX, so I can modify HTML content, iterate through element collections (suppose I have button with id="myButton" - I already can change its caption, change elements, pictures, etc.). The problem is that I can not capture events from within the ActiveX control (here: Web Browser). There is a HTMLElementEvent2 interface, but I don't know how to create my own implementation of Event Sink. Please look at code below and help me with this, or point to proper paper or sample code. Help...

How do I connect to IncrediMail? I use Vista, Windows 7, Virgin
I have used IncrediMail for years and love it but since installing Windows 7 I just cannot connect to it. In consequence, I have had to set up an email account with Virgin Media. I updated IncrediMail to see if that worked - no. I have tried all the "help" but cannot understand what to fill in, in the sections - I need step-by-step instructions. Gringe (or whatever) didn't give enough detail - just gave, "fill in on screen instructions"! I don't know exactly what to type in the sections for IncrediMail. Please help as I cannot use a boring email acco...

Problems using Word as Editor
Am using Office/Outlook 2000. My OS is Windows XPMCE. This just started where I get this error statement: Can't open this item. Microsoft WordMail could not be started. Try one of the following: Close any open dialog boxes in Word. Make susre Word is installed correctly. Close other programs and try again. If I quit Word from the task box or restart my computer, I can open an email and read it in Word because the computer reloads it. If I try to open another or try to write an email I get the message. I've tried reinstalling Office but the problem still persists. I've never had th...

Using Exchange to book boardroom
We've been running Exchange 2k3 for about 3 months now... and everything works great. We'd now like to use exchange to book/manage some of our board rooms. I've read about a couple of ways to do it. Anyone have any suggestions on the 'best' way? ;-) Thanks! You need to setup resource mailboxes for your conference room(s) and either a) set them up to autoaccept meeting requests when there are no conflicts or b) use the AutoAccept Agent (recommended). http://www.microsoft.com/downloads/details.aspx?FamilyID=3D0884E6-C603-491D-BF57-ACF03E046BFE&displaylang=en Configu...

Current System User variable
Does anyone happen to know if there is an attribute that is accessible by query such as filter criteria on a view, that would point to a session variable indicating the current logged in user? This could be used, for example, to display a list of entities that have a relationship mapped to the user entity. Only the entities that have attributes that match the current user would be displayed. Thanks ...

Reprot builder 2.0 how to use URL access parameter
Hi, i will create a link button in my system, when the user click the link, it will redirect to reporting services to open a report, for example the link is http://test-server/Reports/Pages/Report.aspx?ItemPath=%2fCustomer+Sales+Listing&CompanyID=DEMO which CompanyID is my parameter i want pass to the report. When the report load how i can receive this parameter and filter the data column CompanyID=DEMO only will appear in the report. Thanks Yue ...

Advice, help on code using winapi and month-calendar-object of Comctl32.dll
Hello, I tested the following VBA-code (see below) in excel 2000 on Windows XP. And it works The code is used in a userform called CalendarUserForm (height 216 points, width 170 points) with two CommandButtons (OKButton, CancelButton) on the userform.On the userform, the code creates a month-calendar-control using the WIN-API. I know i could use the Microsoft MonthView Control ActiveX-object in MSCOMCT2.OCX. But it is difficult to distribute and install these ocx-files on other systems. info about the month-calendar-object: http://msdn.microsoft.com/library/default.asp?url=/library/en...

Using CFileFind::FindNextFile() in a Loop
I have some doubt using CFileFind::FindNextFile() function. How can I use this function in a loop to check all files matching a particular criteria. When it gets the 'last' matching file what it returns? Also when it gets 'no more' matching files - what does it return? Please help with code example -- as MSDN doesn't say much clear about these things Sincerely Sanjoy Sinha Roy HCL Technologies SSRoy a écrit : > I have some doubt using CFileFind::FindNextFile() function. How can I use > this function in a loop to check all files matching a particular cr...

Using CDC to generate graphics image file
My server application requires generating graphics image files. As you can appreciate, I would rather not develop a complete MFC application, so I don't want to start with code like this: CPaintDC dc(this); m_FirstPaint = FALSE; m_DC = new CDC; m_DC->CreateCompatibleDC( &dc ); m_Bitmap = new CBitmap; m_Bitmap->CreateCompatibleBitmap( &dc, BITMAP_X, BITMAP_Y ); Instead, perhaps there is a way to use CreateDC to create an DC for an image in one of the popular formats such as GIF, JPEG, PNG, ect. I hope you can help me with code that creates the correct DC ...

Printing checks using ML Checks
Is there a way for printing checks using ML Checks without having the "Power user" roles? If I give every roles except the "power user", I am getting this messages: "Not privileged to run this report". But as soon as I give the "Power User" role, everything is fine. Thanks -- Pat Hi Pat, The reports for ML are in the Financial and Purchasing series. You need to make sure these reports are included in one of your roles. I forgot to mention that in my earlier response. Kind regards, Leslie "Pat" wrote: > Is t...

Can I use another OEM cd for a clean install?
I have OEM lic version of XP, but Dell did not provide a recovery disc. Could I use another OEM CD from another Dell? Would this be a license violation??? On May 31, 12:33=A0pm, "Ed H" <edandsa...@NOSPAMcomcast.net> wrote: > I have OEM lic version of XP, but Dell did not provide a recovery disc. > Could I use another OEM CD from another Dell? Would this be a license > violation??? I don't know about that, but Dell is always happy to send you a replacement set of media: https://support.dell.com/support/topics/global.aspx/support/dellcare/en/bac= ...

Printing a Repeated Section Messege like "Continued"
Setting the repeated section property in a report (Access 2007) to Yes, writes the section Heading on the next page when the detail section is not complete at the page break. I would like the bottom of the first page to print "Continued on Next Page" and/or the top of the second page to say "Continued from ...)" so the report reader knows the details are part of the previous section on the previous page, and not in an entriely new section of the report. Can this be done dynamically in a report, since some pages naturally break when a section ends and other pag...