[Last Call] Learn how to a build a cloud-first strategyRegister Now


Modify VBA code so user can use wild cars to input

Posted on 2012-08-13
Medium Priority
Last Modified: 2012-08-13
Is there any way to modify code in the form: line

stLinkCriteria = "[ACCTNO] = [Enter Loan Number]" so user can use wild cads to input.

Purpose of the question: Loan Number being inputted in the format

I would like to modify code so if user by typing in the box "*123456*" should be able to retrieve loan information instead of typing full loan number.
See attached screen shots for your reference

Private Sub cmdIndLoan_Click()
On Error GoTo Err_cmdIndLoan_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Financial-Table form"
    stLinkCriteria = "[ACCTNO] = [Enter Loan Number]"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    Exit Sub

    MsgBox Err.Description
    Resume Exit_cmdIndLoan_Click
End Sub

Open in new window

Question by:maximyshka
  • 2
LVL 61

Accepted Solution

mbizup earned 2000 total points
ID: 38288995
Try this:

stLinkCriteria = "[ACCTNO] LIKE  '*' & [Enter Loan Number] & '*'"

Open in new window


Author Comment

ID: 38289187
Thank you very much!!!
LVL 61

Expert Comment

ID: 38289210
You're welcome!

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

830 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