"Dave the wave" <Bo****@softhome.net> wrote in message
news:wq********************@adelphia.com...
Looking for suggestions.
I am working on a database that records test responses. The test materials
are grouped into 7 categories.
I created a form with 2 combo boxes. The first selects the category -which
value is used to limit the record source of the second. The second selects
the material -which value is used to limit the records viewed in the
detail section of the form.
Using continuous forms layout I am able to see all the tests for that
material only. (Which is what I want.) The problem is I want to avoid
displaying the material name in the detail section. If I add a new record
using this form the material ID is set to "0" instead of the value of the
second combo box.
Thank you for your comments.
....material ID is set to 0?
Could you mean Category ID? In any case check whether you have set a
default value of zero in your table design, and consider whether it helps
you in any way. If not, remove it.
The easiest and most common way to do this sort of thing would be to use a
form / subform combination. The main form would have the 7 categories and
the subform contains the materials. This is also a reliable,
tried-and-tested, zero-code solution.
If you are not persuaded by that, then you will need to write code in the
update event of the form, soemthing like
If Nz(Me!MaterialCat, 0) > 0 Then
' Category already known
Else
Me!MaterialCat = cboMaterialCat
End If
Fletcher