Results 1 to 8 of 8
  1. #1
    jmals24 is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    4

    Question Can't add field with mult. values to b\e - search key was not found

    Hi,

    I am trying to add a field with a combo box which allows multiple values to the back end of a split database. When I do this and then open the form on the front end I get the following error:

    "The search key was not found in any record."

    The values are chosen from a value list that I created.



    If I add a combo box field that does not allow multiple values I can open the form fine.

    The database was created in Access 2007 and is now running on Access 2010.

    How do I fix this?!

    Thanks in advance!

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Are you adding Fields of the same Data Type.
    Does the Combo lookup a separate Table.
    Is the Control Source of the Combo Set to the table's field where you want to store the data.
    Are you storing the Primary Key from the lookup table to the other table.
    Are you using Autonumber as the primary key.

  3. #3
    jmals24 is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    4
    Hi Rain,

    Here are my answers:

    Quote Originally Posted by Rainlover View Post
    Are you adding Fields of the same Data Type. Yes, text
    Does the Combo lookup a separate Table. No, I've added values in the Row Source box
    Is the Control Source of the Combo Set to the table's field where you want to store the data. I am not sure?
    Are you storing the Primary Key from the lookup table to the other table. I am not sure about this either
    Are you using Autonumber as the primary key. No I am inputting unique values as my primary key

  4. #4
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    What code are you using to open this form.

    Is the new data recorded correctly in the table. Look at the table directly.

  5. #5
    jmals24 is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    4
    Hi Rain,

    I have some BeforeUpdate code as follows:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    Dim strMsg As String
    Dim iResponse As Integer
    ' Specify the message to display.
    strMsg = "Do you wish to save the changes?" & Chr(10)
    strMsg = strMsg & "Click Yes to Save or No to Discard changes."
    ' Display the message box.
    iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")

    ' Check the user's response.
    If iResponse = vbNo Then
    ' Undo the change.
    DoCmd.RunCommand acCmdUndo
    ' Cancel the update.
    Cancel = True
    End If
    End Sub

    The Open code is just:
    Private Sub Form_Open(Cancel As Integer)
    End Sub

    I'm not sure about your question re: 'Is the new data recorded correctly" because I cannot open the form at all. If I update the table in the backend, yes it updates and stores correctly. Even the field that is causing the problems.

  6. #6
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Change this ======== DoCmd.RunCommand acCmdUndo

    to --------- Me.Undo

    You are using Old Code

    ___________________________________________

    Private Sub Form_Open(Cancel As Integer)
    End Sub

    This does not open a Form.

    Have another look.

  7. #7
    jmals24 is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    4
    I'm sorry but I do not know where to find the code. Can you walk me through it by any chance? I created the database through the Access GUI.

  8. #8
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    If you can't find the Code how did you post it here.

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

Similar Threads

  1. The search key was not found in any record
    By virtualprg in forum Import/Export Data
    Replies: 46
    Last Post: 08-26-2014, 10:51 AM
  2. Import search key not found
    By patjivan in forum Import/Export Data
    Replies: 0
    Last Post: 12-13-2011, 12:52 PM
  3. Replies: 8
    Last Post: 11-04-2011, 06:52 AM
  4. Replies: 10
    Last Post: 03-28-2011, 08:57 AM
  5. Send mult records to word via VBA
    By claven123 in forum Programming
    Replies: 7
    Last Post: 01-06-2011, 10:52 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
  •  
Other Forums: Microsoft Office Forums