Results 1 to 3 of 3
  1. #1
    LeeTV is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    1

    Varying a control type on a subform - based on record criteria.

    Question: How do I get my subform to show different control (based on each of the subform's record criteria)
    I have a survey database (MS ACCESS), that asks a student to evaluate a course by asking defined questions, the questions are different for each course.
    Currently the subform shows only a combobox where the student enters their response. What I would like to achive is to have an appropriate control based on the question type. i.e. if the question elicits a yes/no response then i'd like to have 2 radio buttons (Yes and no) that allows the student to answer. The problem i'm having is that i can put a radio button on the subform (or whatever control is desired by the questions response), but it shows as a radio button for ALL rows (Other rows may require a Check box answer, combobox, or free text).
    I attempted overlaying all the control types and setting the property to visible=false (based on the response control criteria), but it showed the same control for every record.
    Below is a small example of what i would like to accomplish.
    e.g.
    Parent form = Survey name / Date completed / etc.
    subform (contains questions)

    1 What time did you arrive today [control = textbook]
    2 Did you take the pre-course test? [control = radio button -yes/no]
    3 I found the course to be: [cbobox = excellent, good, fair, bad] etc..

    some of the surveys have 30-40 questions.


    THanks
    Lee

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If you are using bound controls, the control should match the data type of the field in the table.

    If you are using unbound controls to collect User input, you may find the .Visible property beneficial.

  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,645
    LeeTV, that is normal behavior for bound forms and normalized data structure and really can't be altered. Changing the properties of a control will be reflected in all records. Period.
    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: 6
    Last Post: 08-21-2013, 02:51 PM
  2. Replies: 1
    Last Post: 04-08-2013, 11:58 AM
  3. Record Count based on Form control value
    By Monterey_Manzer in forum Forms
    Replies: 7
    Last Post: 11-29-2012, 10:47 AM
  4. Replies: 4
    Last Post: 09-04-2012, 09:17 PM
  5. Open form based on Subform criteria
    By Suzan in forum Programming
    Replies: 0
    Last Post: 04-25-2006, 02:28 PM

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