I am at my wits end with this survey!!!
Currently, I am trying to get my form to save data properly. My survey is set up such that each piece of data (Questions, Answers, Completed Surveys, Answers to Completed Surveys, etc.) each has its own table, and they are linked in Relationships by their Autonum ID #s. My problem is the form I am using to enter data in the Completed Survey table and the Survey Results table. This form is mainly just a link for the 2 subforms in it.
My form has a subform at the top that enters survey demographic data into a query that updates the Completed Surveys table and the Patients table...assigning a number to that particular survey and saving the demographic data on the patient.
The bottom half of the form has a subform that moves from one question to another (questions are in a query) using a "Next" button on the primary form. The answers for each question are selected in a dropdown box (another query) and are saved in the a query based on the results table, along with the Completed Survey ID from the top half of the form...or that is what is supposed to happen.
I have identified the problem (I think) by creating visable text boxes in different places so that I can see what the computer thinks the different ID#s are in different places. The Completed Survey ID in the top subform is copied to a global variable referenced by the bottom subform. The problem seems to be if I put the command to copy to the global variable what is in the Upper CompletedSurveyID text box under "Load" in VBA, it works (the lower subform has the correct CompletedSurveyID), but I get messages that a related record is required in the Completed Survey table, and the questions and answers no longer match up consistently. When I put the commands in "Current", the error messages go away, but the 2 subforms no longer match (the bottom subform holds the number from the first record in the table.
What seems to be happening is that the lower subform needs the upper subform to refresh to take the correct number, but for some reason when this happens I get errors.
Any thoughts?! I really need to get this functioning ASAP. My boss is leaning on me & I have been working on this for several weeks! I can pretty it up later...I just want it to WORK!
BTW...I am using Access 97. Thanks for your time!
My form has a subform at the top that enters survey demographic data into a query that updates the Completed Surveys table and the Patients table...assigning a number to that particular survey and saving the demographic data on the patient.
The bottom half of the form has a subform that moves from one question to another (questions are in a query) using a "Next" button on the primary form. The answers for each question are selected in a dropdown box (another query) and are saved in the a query based on the results table, along with the Completed Survey ID from the top half of the form...or that is what is supposed to happen.
I have identified the problem (I think) by creating visable text boxes in different places so that I can see what the computer thinks the different ID#s are in different places. The Completed Survey ID in the top subform is copied to a global variable referenced by the bottom subform. The problem seems to be if I put the command to copy to the global variable what is in the Upper CompletedSurveyID text box under "Load" in VBA, it works (the lower subform has the correct CompletedSurveyID), but I get messages that a related record is required in the Completed Survey table, and the questions and answers no longer match up consistently. When I put the commands in "Current", the error messages go away, but the 2 subforms no longer match (the bottom subform holds the number from the first record in the table.
What seems to be happening is that the lower subform needs the upper subform to refresh to take the correct number, but for some reason when this happens I get errors.
Any thoughts?! I really need to get this functioning ASAP. My boss is leaning on me & I have been working on this for several weeks! I can pretty it up later...I just want it to WORK!
BTW...I am using Access 97. Thanks for your time!