Repost: Display 1 of 2 subforms based on combo box value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I phrase this wrong in the original post

I have a form (Customers) which has 2 subforms (Support and Product) one
over the other. I am hoping to use a combo box (or any other tool) to have
only 1 subforms displayed depending on the value of the combo box. I am open
to any suggestions to accomplish this task.
TIA
 
On the after update event of the combo, write the code
If Me.MyComboName = Value then
me.SuForm1.visible = True
me.SuForm2.visible = False
Else
me.SuForm1.visible = False
me.SuForm2.visible = True
End If
 
Your choices seem to be product or service.

Why not include both in the same table and flag a text field as "P" or "S"
then you could use a command button to change criteria of a query. The
different criteria would pull the records for the one you want.
 
In attempting the formula below, I get error on MyCombo56
Is the value need to be entered, if so what is the value.

Private Sub Combo56_AfterUpdate()
If Me.MyCombo56 = Value Then
Me.Support.Visible = True
Me.Product.Visible = False
Else
Me.Support.Visible = False
Me.Product.Visible = True
End If

End Sub
 
I believe Ofer used Value as a placeholder. Presumably you know what the
value will be: replace the word Value in the code with that value. (Remember
to put it in quotes if it's a text value)
 
Also remove the My Before the name of the field, And as Doug mantioned, if
the combo field is string type the use that
If Me.Combo56 = "Value" Then

Private Sub Combo56_AfterUpdate()
If Me.Combo56 = Value Then
Me.Support.Visible = True
Me.Product.Visible = False
Else
Me.Support.Visible = False
Me.Product.Visible = True
End If

End Sub
 

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

Back
Top