In a continuous form, can I use a combo box of another query depending on the value of the field or textbox in my own record?

Edit: For those wondering, it appears to be impossible to have the same combo box for two different records in a continuous form, referencing two different queries to populate its list.

I have a continuous form that can hold 5 records. There is a combo box, Laborer1, and you need the dropdown to be different for each form, depending on some other factors. I was able to ask the exact query that I want for each block of records as a text field in this record. What's the next step? At this point, all I can do is apply a single record query to all combo boxes, but I want each combo box to use its "own" query.

Thank!

+3


source to share


1 answer


Yes, you can do this, but there is a tradeoff: inactive entries can have a value that does not match the current row source for the combobox. When this happens, you get an empty combo box instead of showing the current value. If you activate the entry, the value reappears, but this is not a fantastic user interface.

However, one option is to handle it in an event Form_Current

. Since you are already storing the source of the strings in a database field, the code for this is really short:



Private Sub Form_Current
  Laborer1.RowSource = ReferenceField.Value
  Laborer1.Requery 'I don't believe you need this, but you might.
End Sub

      

+3


source







All Articles