Results 1 to 6 of 6

Thread: Could use some VB help with dealing with combo box data from a Union All query

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    VBAX Newbie
    Joined
    Oct 2020
    Posts
    4
    Location
    Quote Originally Posted by OBP View Post
    OK, rather than try and resolve your problem by guesswork on what you are trying to do I will post a copy of the Search 2000 database by Allen Browne to see if the code he uses will give you what you need, it could be something as simple as a missing appostrophy etc.
    Or possibly using a function rather than plain VBA.
    Other than that I would need a zipped dummy copy of the database (less any personal data) to look at the form and code.
    Thanks for responding

    That database pails in comparison to mine and has no commonality to my issue as it is not using a Union or UnionAll Querry to merge data from multiple data fields [BathTypes1] & [BathTypes2] into combined results in a singular combo box (cboBathTypes) and then (where my problem is) attempting to sort it out via VBA

    Remember that cboBathTypes is retrieving merged data from qry_UnionAll

    If my selection from cboBathTypes happens to be originating from [BathTypes1] then this code works:
    If Not IsNull(Me.cboBathTypes) Then ' Baths
         CustomerType = CustomerType & " And ([BathTypes1] = '" & Me.cboBathTypes & "')"
    End If
    But If my selection from cboBathTypes happens to be originating from [BathTypes2] then this code works:
    If Not IsNull(Me.cboBathTypes) Then ' Baths
         CustomerType = CustomerType & " And ([BathTypes2] = '" & Me.cboBathTypes & "')"
    End If
    I need working code that would work regardless where cboBathTypes data originated [BathTypes1] or [BathTypes2]

    I will try to strip down my dbase this weakend to upload if I do not already have resolved

    Thx again
    Last edited by Aussiebear; 02-09-2025 at 03:24 PM.

Tags for this Thread

Posting Permissions

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