Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit Combobox to like records 1

Status
Not open for further replies.

PhilH123

Programmer
Nov 22, 2004
24
GB
Hi All,

I am putting together a Database to look after questionnaire responses from forms created in Excel which have been emailed back in text files.

The questionnaires can change and therefore the database needs to know which questions are associated with which responses - all come back in text files as IDs or Values.

I have three tables

1. tbl_QUESTIONS
- txt_QUESTION_ID (Unique ID for Question)
- txt_QUESTION (Actual Question)

2. tbl_RESPONSES
- txt_RESPONSE_ID (Unique ID for Response)
- txt_RESPONSE (Actual Response)
- sng_RESPONSE_VALUE (Value given for Response 0-5)

3. tbl_QUESTION_RESPONSE
- txt_QUESTION_ID
- txt_RESPONSE_ID


I have a form on which you can edit questions, and a subform which display the responses for that question (linked in tbl_QUESTION_RESPONSE). I want to put a combobox in the subform so that you can change the responses which are associated with the question. But the responses which you can choose from need to have the same sng_RESPONSE_VALUE as that which is already associated.

I can't find a way to limit the combobox to these records, please help it's driving me mad.

Many thanks,
Phil.
 
You can set the query on which the combobox is based to reference a textbox on your form.
 
Hi Remou,

I have tried doing this but always get prompted to enter the parameter on opening the form. I am guessing this is becuse I am having to populate the text box via a query which in turn is referencing the main form.

Phil.
 
Set the recordsource of the combo after the form has been opened. The On Load event or On Current should be suitable.
 
Remou,

Works like a treat. Knew there was a simple way around it but just wasn't thinking Access!!!

I have assigned the recordsource in the GotFocus event of the combo as viewing continuous forms.

Many thanks,
Phil.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top