By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,391 Members | 2,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,391 IT Pros & Developers. It's quick & easy.

"Implying" entries

P: n/a
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.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Dave,

In the form's BeforeUpdate event, set the MatrialID to Me.ComboBox2:

if Me.NewRecord then MaterialID = Me.ComboBox2.

This assumes that ComboBox2 returns MaterialID. If it does not, you can
add it to it in another column, and hide it by setting Width to 0.
Cheers,
Pavel

Dave the wave wrote:

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.

Nov 12 '05 #2

P: n/a
"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

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.