Locking values in combo boxes

jojo86

Registered User.
Local time
Today, 18:30
Joined
Mar 7, 2007
Messages
80
Hi

I have been working on a database that holds information about sites around the UK which are scored on whether they are located well etc. A form has been made that looks up questions and answers from two different tables (answers are in a combo box as each question has at least two answers) which then populates the scores when an answer is selected. This works perfectly well.

However, there are 13 questions and the form is a continuous form, but for some reason when an answer is selected in a combo box, other answers that have been chosen are lost - like it is not 'sticking' to the form.

Does anyone know of any code that can help to store all answers chosen and not just one? If so, please let me know! Thanks :)
 
it sound as though your combo box is not bound to a column in the underlying table and as you are using a continious you have in fact one combo box. Switch to Single form view and see what happens.
 
I think you were right, because I have changed it to a single form view and it works ok now. However, I want to be able to use this as a sub form on my primary form. When I open the form in form view, it asks me for some data that is used in the dLookup.

This form (frmResponses) is going to be used as a subform to the primary form (frmPrimary). The linking field is the ID from frmResponses and frmPrimary. frmResponses is created from a query that finds the question numbers (quesno) as well as the answer numbers (ansno).

In frmResponses, it uses a dLookup to find the QuesNo and QuesText -
=DLookUp("[QuesText]","Question","QuesNo= " & Forms!frmResponse!QuesNo)
But just show the first item (QuesNo) -

Private Sub QuesNo_AfterUpdate()
Me.AnsNo = Null
Me.AnsNo.Requery
Me.AnsNo = Me.AnsNo.ItemData(1)
End Sub

There is also a dLookup that finds the scores and automatically fills the field in when an answer is selected -
=DLookUp("[AnsScore]","Answer"," [AnsNo]= " & "'" & Forms!frmResponse!AnsNo & "'")
but only shows the first item (AnsNo) -

Private Sub AnsNo_Enter()
Me.AnsNo = Null
Me.AnsNo.Requery
Me.AnsNo = Me.AnsNo.ItemData(1)
End Sub

Now, when I open frmPrimary in form view, it asks me for "Forms!frmResponse!QuesNo", and each time I go to pick an answer.

Do you know what is going on with it?
 

Users who are viewing this thread

Back
Top Bottom