Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2009
    Posts
    39

    Unanswered: Text Box/Combo box visibility

    Hi,

    I know the code for making a text box visible based on a single combo box choice, but I am trying to figure out who to insert a wild card feature into the command. I need the text box to be visible when any option beginning with the text "fire engine" is chosen. Here is what I have that works:

    Me.textbox.visible=me.combobox="fire engine"

    I have tried "fire engine *" and "fire engine (*)" to no avail. Any suggestions? Is what I want even possible?

    Thanks :-)

    Steph

  2. #2
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by SRR View Post
    Hi,

    I know the code for making a text box visible based on a single combo box choice, but I am trying to figure out who to insert a wild card feature into the command. I need the text box to be visible when any option beginning with the text "fire engine" is chosen. Here is what I have that works:

    Me.textbox.visible=me.combobox="fire engine"

    I have tried "fire engine *" and "fire engine (*)" to no avail. Any suggestions? Is what I want even possible?

    Thanks :-)

    Steph
    Steph,

    Try:

    Code:
    Me.textbox.visible= (Instr(me.combobox, "fire engine"))
    or

    Code:
    Me.textbox.visible= (Left(me.combobox, 11) = "fire engine")
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    Join Date
    Dec 2009
    Posts
    39
    Thanks, you're a star! That's why I love this forum, it helps having a new set of eyes on an old problem :-) I hadn't even considered using the Left feature!

  4. #4
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by SRR View Post
    Thanks, you're a star! That's why I love this forum, it helps having a new set of eyes on an old problem :-) I hadn't even considered using the Left feature!
    You're welcome!

    Glad we could assist.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  5. #5
    Join Date
    Dec 2009
    Posts
    39
    Ran into another roadblock. Tab 1 has the combo box VEH_TYPE and text box PILOT. Tab 2 has the text box BODY_MANF_NMBR. I need the BODY# to be visible for multiple choices. Here is what I have:

    Private Sub VEH_TYPE_AfterUpdate()
    Me.PILOT.Visible = (Left(Me.VEH_TYPE, 11) = "fire engine")
    Me.BODY_MANUF_NMBR.Visible = (Left(Me.VEH_TYPE, 11) = "fire engine")
    Me.BODY_MANUF_NMBR.Visible = (Left(Me.VEH_TYPE, 3) = "c.c.v.")
    End Sub

    I swear it worked at first, and then I went to distribute it and of course it decided to only partially work (secretly, I think the program has it out for me...). PILOT is working correctly. BODY_MANF_NMBR is visible when "c.c.v." is chosen, but not when "fire engine" is chosen. As I am still new to this code writing thing, am I missing a phrase/command somewhere?

    Thanks in advance :-)
    Last edited by SRR; 05-07-10 at 19:45.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •