Hopefully I can find some words of advice from somebody.
Is it possible to create forms 'on-the fly' so to speak in MS-Access 2007
I have a structure of tables:
tblCustomer
tblQuestAnsA customer may answer the questionnaire answers many times as they relate to all products.
I propose to hopefully have an initial input form that will ask how man开发者_如何学运维y products of which there could be more than 1 eg: TV, Video (say the user selects 2)
On entering that data the next form should hopefully update itself to include the list of questions eg
TV
Q1, Q2 Q3
-
Video (1)
Q1, Q2 Q3
-
Video (2)
Q1, Q2 Q3
Is that possible? Any point in the right direction would be appreciated.
Thanks Noel
You'd probably want to do a subform with a variable number of records.
Rather than create a form on the fly, how about the following?
Create a form which has a continous subform to display questions for a customer.
After the customer answers how many products on the initial input form, you create blank records in the answers table.
Then open the questions form which loads the customers blank records for them to answer.
I'm not 100% clear on how the questions are being associated with the product, or how the user is selecting the products they are inputting information on, but one possibility is to populate an array and then pull up a form for each product that was selected with the associated questions.
To properly loop through the array you would use a function to wait for the form to close before moving on to the next index. Here's a function that I use:
Sub WaitForFormClose(strFormName As String)
While SysCmd(acSysCmdGetObjectState, acForm, strFormName) = acObjStateOpen
DoEvents
Wend
End Sub
精彩评论