Results 1 to 10 of 10
  1. #1
    Triel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    14

    Display detail subform from button click on continious form

    I am stuck in creating this database. I keep googling and never find what I need, any help would be greatly appreciated.



    I have a continuous form defined and in the footer I have the detail form. On my continuous form it just lists the question and has an edit button and a delete button. My delete of course works perfectly fine but I can't get my detail to work how I want. This form gets displayed from a login page depending on who is logged in, when the form first is displayed the detail does not show (this is supposed to be this way). They then choose a group from the drop down and it displays all of the questions that belong to that group. Then if they want to edit a question they click on the button next to the question they wish to edit. My sub-form does then appear when you click on the button but there is nothing in it.

    The Record Source for the subform is a query: SELECT qryQuestion.qaPKID, qryQuestion.qaQuest, qryQuestion.qaAnswr, qryQuestion.fkgpPKID
    FROM qryQuestion;

    I use the property sheet on sub-form to set the Visible to "No" and when the button is clicked I set it to "Yes".


    Hopefully someone can guide me what I am doing wrong. I thought earlier I could see the fields in my sub-form but now it only has frmSubformDetail inside as you can see from the image. Did I do something to mess that up?

    Thanks!
    Attached Thumbnails Attached Thumbnails frmFAQ.png  

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    That's what happens you also have the subform open, which I can see you do have both forms open.

    What is the RecordSource of the main form?

    What is the sql statement of qryQuestion?

    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.

  3. #3
    Triel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    14
    Quote Originally Posted by June7 View Post
    That's what happens you also have the subform open, which I can see you do have both forms open.
    Well, that was just in design mode. I used to be able to see it.

    Quote Originally Posted by June7 View Post
    What is the RecordSource of the main form?
    SELECT * FROM qryQuestion WHERE (((1)=0));


    Quote Originally Posted by June7 View Post
    What is the sql statement of qryQuestion?
    SELECT faqQA.fkgpPKID, faqQA.qaQuest, faqQA.qaAnswr, faqQA.qaPKID FROM faqQA;

    faq.zip

    Thanks!

  4. #4
    Triel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    14
    I just tried to run this and now I am getting an error so I must have changed it yesterday and didn't test it. It was working yesterday except for the sub-form not showing. *Sigh*

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I open frmFAQ in design view and the subform shows just fine.

    If I first open frmSubformDetail in design view, then frmFAQ does not show the subform.

    Main form and subform have the same datasource. This makes no sense to me.
    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
    Triel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    14
    Quote Originally Posted by June7 View Post
    Main form and subform have the same datasource. This makes no sense to me.
    I did get it to show but it seems I have an error now from some change I must have done. I been running around and I don't remember what I changed to try to get the sub-form to display when I was running it.

    What this is supposed to do is you sign in, I been using ROD and rod as the password. It would then open up the frmFAQ form and populate the drop down with the groups. I selected which group and it showed the questions (It is not supposed to show the sub-form at this point). You then can click on the "+" next to the question you want to edit and the "detail" sub-form is supposed to show with the question and answer so you can edit them. *NOTE: I did not put the buttons to save the changes yet on the sub-form. I just wanted to get it to show up when it was supposed to.

    So, the main form and the sub-form should have the same source no?

    Thanks!

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Main form and subform with same datasource does not make sense to me.
    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
    Triel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    14
    Quote Originally Posted by June7 View Post
    Main form and subform with same datasource does not make sense to me.
    So, what should it be? You do understand what I am trying to accomplish correct?

    The main form just lists the questions and the button to edit or delete the line and then if they press the edit button that line should appear in the subform with both the question and answer so they can change it.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Having multiple forms bound to the same data can cause issues. If you initiate edit of the same record in both forms, will possibly error. But you say this edit process was working before?

    Need to change the combobox AfterUpdate code. It changes the form RecordSource but does not include the qaPKID field so the subform container Master/Child links don't have the master link key. However, I cannot get the code to work even after this fix. Makes me think corruption. I tried eliminating the query object as data source and just pull from table, also tried rebuilding combobox and subform container. Nothing helped.

    I really don't see need for the subform. List full records on main form.
    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.

  10. #10
    Triel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    14
    Quote Originally Posted by June7 View Post
    Having multiple forms bound to the same data can cause issues. If you initiate edit of the same record in both forms, will possibly error. But you say this edit process was working before?
    It was working except it was not showing the subform, probably because it did not have the qaPKID like you said below. I redid the subform and probably forgot to change the form recordsource. I don't want to edit on the main form, that is for display only. The editing is only taking place on the subform. I believe I changed the values to not allow editing on the main form. If I didn't, they will be changed.

    Quote Originally Posted by June7 View Post
    Need to change the combobox AfterUpdate code. It changes the form RecordSource but does not include the qaPKID field so the subform container Master/Child links don't have the master link key. However, I cannot get the code to work even after this fix. Makes me think corruption.
    Ok thanks! Yes, I was getting errors after I sent it to you (I tried it AFTER I attached it). Stupid me should have never saved it right before I sent it to you. I left my computer on overnight and just had it locked with the database open. But as you see I do have a "saved" version of the form. I saved that before I put the subform in it so I had a place to go back to if something go screwed up.

    Quote Originally Posted by June7 View Post
    I really don't see need for the subform. List full records on main form.
    As for the subform, that is how this guy here wants it to be. I can't do anything different because then he will go complain that I don't listen to him. Even though he is NOT my boss he always acts like he is. I dislike the situation but I have to live with it or go somewhere else.

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

Similar Threads

  1. Replies: 6
    Last Post: 11-18-2013, 12:03 PM
  2. Replies: 5
    Last Post: 01-15-2013, 07:28 PM
  3. Replies: 6
    Last Post: 01-11-2013, 11:33 AM
  4. Filter subform on button Click
    By atom in forum Forms
    Replies: 2
    Last Post: 04-18-2012, 09:43 AM
  5. Replies: 1
    Last Post: 03-31-2012, 01:38 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