Results 1 to 7 of 7
  1. #1
    bholgate is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2015
    Posts
    4

    many forms, how to select current record

    I'm making a questionnaire database. First page is a traditional form (frmNew Record) with 8 fields from my table (tblRecords). All is well at this point. I can make it start a new record and all the fields link back to the table correctly. After clicking 'start test' I have 20 separate forms (frmPTTest1, PTTest2, etc), all with one question each, that link back to fields in the table (tblRecords). It's very basic, every page has a question and they click a button when they have done what it requires to proceed to the next page. I changed the control source on all buttons to coincide with the corresponding fields. My problem is this: on the first run through with a fresh table it selects all the checkboxes but if I go through and start a 2nd and 3rd record, it undoes the checkboxes from the first record. I can't make it stay with the current record. I don't want my users to have to use the record selector at the bottom and have actually removed that. I have tried so many things and been reading through forums for hours with no luck. Thank you for your time.

  2. #2
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    >>I changed the control source on all buttons
    Buttons don't have control sources, so I'm lost there.

    >>it selects all the checkboxes
    all what checkboxes?

    >>
    start a 2nd and 3rd record
    What is another record, a second a third time through the quiz from a different user? Or is it the answer to a second and third question?

    What record selector are you talking about. Maybe you should provide the table design as well as a screen shot of the quiz so we can see what you're talking about.

  3. #3
    bholgate is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2015
    Posts
    4
    Click image for larger version. 

Name:	Access1.png 
Views:	9 
Size:	44.9 KB 
ID:	22316Click image for larger version. 

Name:	Access2.png 
Views:	9 
Size:	22.0 KB 
ID:	22314Click image for larger version. 

Name:	Access3.png 
Views:	9 
Size:	44.7 KB 
ID:	22317
    Attached Thumbnails Attached Thumbnails Access1.png  

  4. #4
    bholgate is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2015
    Posts
    4
    Here are some pictures that show what I'm talking about. You can see that the toggle button does indeed have a control source. The check boxes are yes/no toggles that the toggle button changes. When I say another record I mean another entry in the table. So, you can see from the picture of the table what I'm talking about. The top entry with serial #: ABC123 is the first record or entry, and the one called test is the second. So what I'm saying is that when I go through all the forms clicking 'Done', it toggles the checkbox in the table for the first record only. Then when I start a new record/entry IE the one called "test" in the screenshot, it just overwrites the checkboxes in the table from the first record/entry in tblRecords.

  5. #5
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    I think I'm understanding better now. So the tabs have the user fill out info and when the last tab is completed and the Done button pressed it writes the record to tblRecords (or does each tab write part of the record?), or is it changing the data on the open tab tblRecords?. Can you provide the code behind the done button?

    A simple way to write a record on click of the done button would be to execute an append query to tblRecords.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Toggle buttons have a ControlSource but command buttons don't. Why would you need toggle buttons?

    Why is there a separate form for each PTTest? Are they really different?

    Why do you need code to write records?

    If you 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.

  7. #7
    bholgate is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2015
    Posts
    4
    I revieved a proper answer in the Microsoft forums. I will post here in case anyone else is following:

    "With the table structure you are using I'd suggest using unbound forms for all but the first form. Having inserted a new row via your bound New Unit Test form you pass its primary key to each subsequent form opened as its OpenArgs property. The record created in the first form can then be updated in each subsequent form by executing an UPDATE statement in code,

    I would point out that storing the answer to each question as a Boolean column in each row is not a good design as it encodes data as column headings. A fundamental principle of the database relational model is the Information Principle (Codd's Rule #1). This requires that all data be stored as values at column positions in rows in tables, and in no other way. "

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

Similar Threads

  1. Adding a Count function to current select statement
    By johnson8809 in forum Queries
    Replies: 2
    Last Post: 02-21-2015, 07:32 PM
  2. Showing Current Record in Forms
    By wes9659 in forum Forms
    Replies: 1
    Last Post: 04-15-2014, 02:34 PM
  3. Replies: 7
    Last Post: 12-15-2013, 08:42 PM
  4. Select on current and archive table.
    By lugnutmonkey in forum Queries
    Replies: 2
    Last Post: 01-09-2013, 09:02 AM
  5. Replies: 3
    Last Post: 08-26-2012, 10:04 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