Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    exclude value from combo box Record Source

    I want to select records from the table CNotes_EOS to be the Row Source of a combo-box when they are not already in the table where they will be stored (tbeCNotes_EOS)

    tbeCNotes_EOS could have records already added from the table CNotes_EOS;


    it may also have no records, or records that have been added by the end user and not fond in CNotes_EOS (and of consequence the values in the tbeCNotes_EOS.CN_ID would not be in the source table...)

    when i do have at least (1) record in the table tbeCNotes_EOS with a value for CN_ID that is in CNotes_EOS this row source query is spot-on;

    Code:
    Not In (SELECT [CC_ID] FROM [tbeCNotes_EOS])
    but, if there is none, the open form event fails

    the code behind the form open is
    Code:
    Private Sub Form_Open(Cancel As Integer)
        Me.txtNoteText = ""
        Me.lblNoteText.Visible = False
        Me.txtNoteText.Visible = False
        Me.cmdAddNote.Visible = False
        Me.cmbCNoteTitle.Enabled = True
        Me.cmbCNoteTitle = ""
        Me.cmbCNoteTitle.Visible = True
        Me.cmbCNoteTitle.SetFocus
    End Sub
    any work-arounds, comments, or other suggestions would be greatly appreciated in advance,
    mark

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Use a 'Find Unmatched' query. Join the tables (LEFT or RIGHT, not INNER). Then the criteria under CC_ID field would be Is Null. Use DISTINCT or GROUP BY to eliminate duplicates.
    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.

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    perfect
    thnx

    new trick learned!!

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

Similar Threads

  1. Replies: 19
    Last Post: 06-26-2018, 07:13 AM
  2. Replies: 2
    Last Post: 02-26-2015, 03:20 PM
  3. Replies: 8
    Last Post: 10-13-2014, 02:44 PM
  4. Replies: 1
    Last Post: 11-28-2013, 10:03 PM
  5. Replies: 14
    Last Post: 05-25-2012, 02:40 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