Subform combo box visible issue

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

Hi All,

I have a subform that contains 3 combo boxes.

cboBox1
cboBox2
cboBox3

cboBox2 and cboBox3 are set to visible = no.

Selecting the product type from cboBox1 determins which cboBox visible or not.


My problem is when I have already made my choice in cboBox1, I'd like the
corrisponding cboBox to remain visible for that record. What happens if I
move to the next record in the main form and go back cboBox2 or 3 don't show
regardless. I then have to select cboBox1 again for the correct cboBox. Yes I
know it's doing what I am telling it todo. What I need to know is where in
the properties would I place the code to keep the correct cboBox visible for
the selected record.

How would do this? I had put some code in the subform Got Focus, but that
doesn't do it.

Matt
 
G

Guest

First, use the form Current event to determine which combo to make visible
based on the values in the current record. You will also want to make them
both invisible for new records:

If Me.NewRecord Then
Me.Combo2.Visible = False
Me.Combo3.Visible = False
ElseIf (condition that tells if combo 2 should be visible) Then
Me.Combo2.Visible = True
Me.Combo3.Visible = False
Else
Me.Combo2.Visible = False
Me.Combo3.Visible = True
End If

Continue to use Combo1's After Update event to make the one visible and the
other not visible.

Do not change the visible property of either at any other time other than
those above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top