Runtime Error 2424 expression u entered has a field,control or property name the Access cant find

Posted on 2004-11-11
Last Modified: 2010-08-05

I have a combp box that looks up Client Names..
On change it chages the Record Source values in the form of a sql staemnet to bring up relevent records on a subform..

It brings them up ok so fantastic..

I have a combo box on the subform that looks up relevent answers to the question that the use can choose from..
This is the code..

Dim tempclientid As Integer
Dim tempQuestionID As Integer
Dim tempsql As String

tempclientid = ClientID
tempQuestionID = questionsID

tempsql = "SELECT [Export StockQA].AnswerValue FROM [Export StockQA] WHERE (([Export StockQA].ClientID)=" & tempclientid & ") AND (([Export StockQA].QuestionsID)=" & tempQuestionID & ");"
Debug.Print tempsql

[Combo8].RowSource = tempsql

This subform works 100% when its not a subform..
When it becomes a subform and I click in the combobox to get the relevent answers it comes up wiht the error...

Can anyone help?
Question by:funkkube
    LVL 12

    Expert Comment

    I *think* what's happening is:

    When the form becomes a subform, all the references in code are interpreted in relation to the parent form.  So I think your last line
         [Combo8].RowSource = tempsql
    should be
         Me!TheNameOfTheSubformControl.Form![Combo8].RowSource = tempsql

    Obviously, change TheNameOfTheSubformControl to the name of the subform control on your main form (the name that shows in Properties when you have the MAIN form in design mode and click once on the area of the subform).

    Author Comment


    I will try that but here is some more info...

    the subform is in datasheet view and I have hidden the clientid and questionid columns..
    i unhid them and this #Name?  was what was in all the clientid fields in all the records..
    it is bringin up the correct records but the clientid is going funny..

    any ideas??
    i will try ur suggestion ptech

    Author Comment

    no joy..
    i defintely think its got something to do with


    in all the clientid values...
    LVL 12

    Expert Comment

    Hm....yeah, my guess above didn't quite pan out.  (Should have tested first, huh?)

    What is the datasource for your subform?  How are it and the main for related (have you set the master/child fields)?

    Author Comment

    i put a msgbox in to see where it was falling over and its ok now?????
    what on earth is that all about?
    is the PC too fast for access??

    Author Comment

    not used master/child fields..
    i had a problem with it..
    the primary key is not the first autoneumber field..
    LVL 12

    Expert Comment

    One more hunch (you'd think I'd learn, already being wrong once on this question....)

    Do you have some updating of records occurring in your processing, and if so, do you force the subform to requery?  
    LVL 26

    Accepted Solution


    tempclientid = Me.Parent.ClientID


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
    Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now