Results 1 to 4 of 4
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    IF textbox on form has this value, with wildcards???

    I have a form that has multiple textboxes. I am creating an IF statement, basically if value = this then that.. Here is the problem I am having, sometimes the textbox has MORE then one piece of data in it.



    ---This works just fine---
    --Form txtroles.value = First Base--

    --This code works in this case---
    If Forms!frmmainnew!.txtRoles.value = "First Base" Then
    do this
    end if
    ----------------------------------
    ---This does not work at all---
    --Form txtroles.value = First Base, Center Feild--

    --This code does not work in this case---
    If Forms!frmmainnew!.txtRoles.value = "First Base" Then
    do this
    end if
    ----------------------------------


    Can I wrap wild cards around "First Base" so it just looks at the whole text?? Does VBA even support wildcards??

  2. #2
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    I was able to do what I needed... THanks for listening lol

    If Forms!frmmainnew!.txtRoles LIKE "*First Base*" Then

    Anyone see any issues with it??

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Only issue I see is that you're violating the 'Atomic Rule' of relational databases; you're storing multiple pieces of data in a single Field.

    Linq ;0)>

  4. #4
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Quote Originally Posted by redbull View Post
    I was able to do what I needed... THanks for listening lol

    If Forms!frmmainnew!.txtRoles LIKE "*First Base*" Then

    Anyone see any issues with it??
    If [Forms]![frmmainnew].txtRoles LIKE "*First Base*" Then

    hope this helps.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA Wildcards
    By dssrun in forum Programming
    Replies: 11
    Last Post: 03-31-2011, 08:44 AM
  2. SQL Wildcards
    By sandlucky in forum Queries
    Replies: 4
    Last Post: 03-28-2011, 03:31 AM
  3. Using wildcards with between workaround
    By rushforth in forum Queries
    Replies: 2
    Last Post: 11-10-2010, 02:12 PM
  4. Using wildcards (*) in SQL
    By SIGMA248 in forum Queries
    Replies: 1
    Last Post: 07-22-2010, 08:44 PM
  5. Wildcards?!
    By esx_raptor in forum Access
    Replies: 3
    Last Post: 02-19-2010, 03:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums