Results 1 to 2 of 2
  1. #1
    trigirl67 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Posts
    3

    multiple combo boxes recordset clone

    I have 3 combo boxes, first has the choice of ID or name, the second gives a list of either IDs or names bases on what is picked on the first box and the 3rd box is a date. I want to do recordset clone for the other fileds on the form after update on the 3rd combo box.

    If ist box is "ID", then choose id and date and condition would be where the 2nd and 3rd combo boxes equal the table values, BUT if the 1st box is "name" then pick the name from 2nd box and the date and where they match.
    Here is what I have so far:
    Private Sub RequestDate_AfterUpdate()

    Dim rs As Object
    Set rs = Me.Recordset.Clone
    If [Searchbox] = "TIN" Then
    rs.FindFirst "[TIN]=" & Str(Nz(Me![Combo148], 0)) & " AND " & _
    "[Request Date] = #" & Me![RequestDate] & "#"

    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End If


    TIN is the id.
    This works ,but how do I include the second condition of when [Searchbox] = "Name" because I think findfirst is only for one critieria.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    So if selection in searchbox is Name you want the search on name instead of ID? Use an ELSE or ElseIf.

    If [Searchbox] = "TIN" Then
    'do this FindFirst search
    ElseIf [Searchbox] = "NAME" Then
    'do this FindFirst search
    End If
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Replies: 3
    Last Post: 01-30-2012, 09:43 AM
  3. using multiple combo boxes in one form
    By quandore in forum Access
    Replies: 5
    Last Post: 01-30-2012, 03:03 AM
  4. Replies: 3
    Last Post: 09-29-2010, 09:31 AM
  5. Filter form from multiple combo boxes
    By Bird_FAT in forum Programming
    Replies: 6
    Last Post: 05-19-2010, 09:32 AM

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