Dlookup returning null

Posted on 2012-08-24
Last Modified: 2012-08-24
I have a table tMHFrame and in that tabel is a string for "Frame".  A value of frame could be something like "Rikki A12*" or "Rikki A12"

A user selects a frame from this table but on the form the only part of the model is used and the reset is stipped to only use the value of "Rikki" and drop the remaing "AXXXXX" values.

I would like to see if a user entered value (dFrameModel, which in this case would be "Rikki" ) is also in the table AND if that value in the table contains an "*" at the end.

This Dlookup is always returning null.  Any idea why?  So I'm basicaly trying to search in the table for "Rikki*" & "*"

sTest = DLookup("Frame", "tMHFrame", "Frame='" & dFrameModel & "*'" & "" * "")
Question by:thandel
    1 Comment
    LVL 61

    Accepted Solution

    Try this:

    sTest = DLookup("Frame", "tMHFrame", "Frame LIKE '" & dFrameModel & "*' AND Right(Frame,1) ='*'") 

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    794 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now