Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    does not recognize valid field name (A2003 SP2)

    Hi All,
    I've been messing with this all afternoon and into this evening and a couple of more sets of eyes are sure welcome. <img src=/S/eyeout.gif border=0 alt=eyeout width=15 height=15>
    In the attached database (2002-2003 format), open frmDeptReport, then click on the <<Find Department or Acct Number>> button at the upper right on the form. That opens popfrmDeptAcctSearch, a GoTo/search popup. I am unable to search by Department. I receive *The Microsoft Jet database engine does not recognize 'DeptDescriptionPKID' as a valid field name or expression.* error and I have not been able to track to the cause. I seem to be using the same type of search for the Index Codes, but that works. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>
    Will someone please be so kind as to point out the source of this error to me? <img src=/S/surrender.gif border=0 alt=surrender width=31 height=23>
    Thank you.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: does not recognize valid field name (A2003 SP2)

    You change the Record Source of frmDeptReport in the On Open event of the form to an SQL string that does not include DeptDescriptionPKID as a field.
    You don't notice this immediately, since there is no control on frmDeptReport that is bound to DeptDescriptionPKID.
    But when you use

    .FindFirst ("DeptDescriptionPKID = " & lngDeptDescPKID)

    in the code behind popfrmDeptAcctSearch, on a recordset clone of frmDeptReport, the missing field causes an error. You'll have to add DeptDescriptionPKID to both the SE:LECT and GROUP BY clauses of the SQL string:

    strSQLFilter = "SELECT [AccountsPKID], DeptDescriptionPKID, [DeptDescription], " & _
    "[Index], [Org], [Fund], [AcctDescription], " & _
    "[AccountEmailAddress], [DateUpdated] "
    strSQLFilter = strSQLFilter & "FROM qryAccountInformation_DeptReport "
    strSQLFilter = strSQLFilter & " GROUP BY [AccountsPKID], DeptDescriptionPKID, [DeptDescription], " & _
    "[Index], [Org], [Fund], [AcctDescription], " & _
    "[AccountEmailAddress], [DateUpdated] "
    strSQLFilter = strSQLFilter & "ORDER BY [DeptDescription], [Index], [Org], [Fund]"

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: does not recognize valid field name (A2003 SP2)

    Thank you Hans. I couldn't find where things went askew for the life of me. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •