Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2003
    Posts
    4

    Angry Unanswered: User Defined Field Names in a Query

    I know I have seen this before but I just cant seem to find the one web page with this on it. My question is ...

    How do you reference user defined field names, like MyField: blahblah in the design grid. I want to reference the MyField in the Criteria section of another field. [MyField] acts like I want to enter a parameter. I thougt it was some special symbol, but I cant remember it.
    Help!~Thanks!

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    forms!formName!fieldname

  3. #3
    Join Date
    Jul 2003
    Posts
    4

    Thumbs down

    Originally posted by axsprog
    forms!formName!fieldname
    Nope not what I am looking for. It is in a QUERY Design Veiw. A Query Field Name like MyField: Left$([field],1). Then How do I reference MyField in the Criteria Section of another field like [Field2]

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    create an alias

    New column name in the grid

    myAlias:[FieldName2]

  5. #5
    Join Date
    Jul 2003
    Posts
    4

    Thumbs down

    Originally posted by axsprog
    create an alias

    New column name in the grid

    myAlias:[FieldName2]

    Nope. Let me put down another way. I have a calculated field i the design grid say

    InvCost : [field1]+[field2]

    and I have another field

    ActCost: [Field3]-[Field4]

    Now I want to make sure that ActCost is Less than InvCost. If I put <[InvCost] in the CRITERIA section of ActCost is prompts me like it is looking for parameter. Not what I want. I want it to reference my ALIAS of InvCost and do the expression. Thanks

  6. #6
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    as long as the criteria field comes AFTER the alias that is being evaluated it should run

    <[MyAlias]

    can you zip a small example if this is not the case

  7. #7
    Join Date
    Jul 2003
    Posts
    4
    Field ComPrc: Val(Mid$([PoItemMsgTxt],[STRPOS],7))
    Table
    Sort
    Show
    Criteria

    Field CstDff: [RevItemListCost]-[RevNetInvoice]
    Table
    Sort
    Show
    Criteria Here is where I want to reference ComPrc, but <[ComPrc] does not work. I thought there was some other way to reference a user field with some other special character not with the brackets

    Maybe it is because I use the user definded field name [STRPOS] in the first field and Access cant keep track of it at the second level

  8. #8
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    Could be - create aliases all the way down the line and see if that eliminates it.

    remember - to reference one alias , that alias must come before the next reference to it.

Posting Permissions

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