Results 1 to 9 of 9
  1. #1
    kinsesyete is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    4

    Angry Access subform with additional field but not editable

    I created an instructor form with a sub form table on the bottom - [pic at the bottom]




    I would like to add columns in the subform from the instructor_info subform but it should not be editable, just display it as per the column relationship key, and the relationship key for the 2 tables (instructor_info & course_table) is course_id.


    Course Table
    - Course Date (instead of Course)
    - Course Location
    - Station Demo
    - No. of Teachings
    - Hours Taught


    Instructor Teaching Info Table
    - Instructor ID
    - Alone
    - Course
    - Course Date
    - No. of Teachings
    - Course Type
    - Notes


  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Do you mean allow new records but not be able to edit the ones already saved?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Not clear to me what you are asking for. You don't want the course records editable? Set form AllowEdits, AllowAdditions, AllowDeletions properties to No. Or set the subform container control Locked property to Yes, or Enabled property to No.

    How do you want to add new course records?
    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.

  4. #4
    kinsesyete is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    4
    Hi sir,

    Thanks for the reply. I want to add columns below but only view it, basically the SQL a field for example is SELECT [Course Table].course_date FROM [Course Table] WHERE course_idColumn = [Course Table].course_id;
    For example, course date would be different per row since the course_date info is connected with the [Course Table].course_id

    - Course Date (instead of Course)
    - Course Location
    - Station Demo
    - No. of Teachings
    - Hours Taught

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Options for displaying related info from another table:

    1. multi-column combobox

    2. include table in the form's RecordSource with LEFT or RIGHT join (not INNER) - don't allow edit of the related info field, set textboxes as Locked Yes, TabStop No

    3. DLookup() expression
    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
    kinsesyete is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    4
    Hi,

    is this right?

    Code:
    SELECT[Instructor Teaching Information Table].instructor_id,
    [Instructor Teaching Information Table].alone, 
    [Instructor Teaching Information Table].course_id,
    [Instructor Teaching Information Table].course,
    [Instructor Teaching Information Table].num_teachings,
    [Instructor Teaching Information Table].course_type,
    [Instructor Teaching Information Table].notes,
    [Course Table].course_date,
    [Course Table].location,
    [Course Table].station_demo,
    [Course Table].hours
    FROM [Instructor Teaching Information Table]
    RIGHT JOIN [Course Table]
    ON [Instructor Teaching Information Table].course_id = [Course Table].course_id;
    But it shows me Type mismatch in expression

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Mismatch on the course_id fields?

    I don't know your data structure. If these are properly related primary and foreign key fields the query should work.
    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.

  8. #8
    kinsesyete is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    4
    this is the data structure:
    Click image for larger version. 

Name:	structure.jpg 
Views:	4 
Size:	100.3 KB 
ID:	18755

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You are not linking the tables on course_id. You are saving course_name into Teaching Information.

    None of your links are on the designated primary key ID fields. None of the ID fields values are saved as foreign keys. The ID fields are useless with this arrangement.
    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.

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

Similar Threads

  1. Replies: 5
    Last Post: 07-15-2014, 09:56 PM
  2. Unbound Form and Editable Subform
    By tndinnc in forum Forms
    Replies: 6
    Last Post: 04-19-2013, 05:42 PM
  3. Replies: 18
    Last Post: 04-22-2012, 11:39 AM
  4. Replies: 1
    Last Post: 04-18-2012, 07:38 AM
  5. Updatable & editable subform?
    By jfn15 in forum Forms
    Replies: 2
    Last Post: 06-21-2011, 10:35 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