Results 1 to 2 of 2
  1. #1
    lbcarvalho is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    31

    Data type incompatible in the criteria expression when using a query and a table with a drop box

    Hi,

    I have created a table called PAYMENT TYPE, with fields like CREDIT CARD, CASH, CHECK, etc. I have used this first table to create a drop box in a second table. Now I want to build a query to show, say, every record with the field CASH, but every time I try this Access gives me the error message: Data type incompatible in the criteria expression.

    What am I doing wrong?

    Is it not possible to use a query to get only the field CASH, for instance?

    Thanks in advance!

    lbcarvalho

  2. #2
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    1st, all those options are attributes of entity "payment type" thus they ought to be records in tblPmtType, not fields in tblPayments. Improper normalization will continue to thwart you as it seems to be the case here. The litmus test is "If I need another payment type must I add another field?". If the answer is yes, the design is wrong.
    The error message also suggests that the field is a lookup field in your table, which is another issue if true. While you see CASH, the actual relevant value is a number that corresponds to the position in a hidden table, like 1. This would explain your issue, I think. You can a) pass the correct number b) use the .Value property in the field (as in NameOfField.Value or c) do away with the lookup field.
    Last edited by Micron; 06-08-2019 at 12:38 PM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 03-14-2017, 02:36 PM
  2. Replies: 3
    Last Post: 08-10-2016, 11:26 AM
  3. Replies: 6
    Last Post: 07-29-2016, 06:09 PM
  4. Replies: 2
    Last Post: 12-21-2013, 11:37 AM
  5. Replies: 4
    Last Post: 05-17-2013, 04:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums