Results 1 to 6 of 6
  1. #1
    nightwolf84 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    4

    Can't access subdatasheets... keep getting "expression is typed incorrectly..." error

    Every time I try to click the '+' button in my parent table to view the corresponding subdatasheet(s) for each record I get this error:

    This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables.

    After reading several threads, I thought maybe I was making the same general mistake in that the fields of my primary and foreign keys were not the same. This, however, is not true, yet I continue to get this error message.

    Here's what I have:

    Student Table:
    StudentID (autonumber) (PK)
    Last Name (text)
    First Name (text)

    ClassResult Table:
    ClassResultsID (autonumber) (PK)


    StudentID (number) (FK)
    Class (text look-up)
    Class Date (date/time)
    Result (text look-up)

    Each student (StudentID) can have more than one class record (ClassResultsID). My PK is autonumber, and the FK is number... so why do I continue to get this error???
    I've even closed out of the program and restarted several times to no avail. ANY help would be greatly appreciated!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you sure the link in the Relationship builder is set to the correct fields?

    Want to provide db for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    nightwolf84 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    4
    I'm pretty sure. I have StudentID from the Student Table (PK) tied to StudentID in the ClassResult Table (FK). I checked marked the reference integrity box prior to creating the link and it shows a 1 to Many relationship. I'll attach my db in the morning when I'm back at work.

  4. #4
    nightwolf84 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    4
    Quote Originally Posted by June7 View Post
    Are you sure the link in the Relationship builder is set to the correct fields?

    Want to provide db for analysis? Follow instructions at bottom of my post.


    Here's my db. Thanks for the assist.
    Attached Files Attached Files

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Setting relationships with Classes and Result (rename as Results) error because the datatype of the PK/FK fields mismatch. If you want to save the number IDs then the FK fields must be number type to agree with the PK autonumber type. Personally, these attributes are so short, I would just save the text values as described below. I avoid Lookups as much as possible. http://access.mvps.org/access/lookupfields.htm

    The Lookups would be unnecessary if the text values are saved. Change properties:
    RowSource: SELECT [Result] FROM Result ORDER BY [Result];
    ColumnCount: 1
    ColumnWidths: 1"

    Change the PK in Result to the Result field.

    Do same for the Classes table.

    So either change the FK fields to number or make above changes and replace the number values with the text values.

    The Students table appears to be corrupted. I created a new table and reset Relationship and it works.

    StudentEntryForm has controls with invalid ControlSource.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    nightwolf84 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    4
    Thanks!!!

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

Similar Threads

  1. Replies: 2
    Last Post: 06-07-2012, 02:59 PM
  2. Replies: 1
    Last Post: 05-24-2012, 12:34 PM
  3. This expression is typed incorrectly
    By Ray67 in forum Queries
    Replies: 9
    Last Post: 01-03-2012, 12:53 PM
  4. Replies: 3
    Last Post: 12-30-2011, 12:43 PM
  5. Replies: 3
    Last Post: 03-31-2011, 11:07 AM

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