Results 1 to 6 of 6
  1. #1
    Niki is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    32

    Multiple Recordset Clones

    Hello - I am trying to create a form that has multiple recordset clones pulling from the same information.

    Say there are 5 combo boxes on the form. In the first one you would select the name and then the phone number would be filled in beside the combo box. Then you would select a different name from the second combo box from the same information and that person's phone number would pop up beside that combo box and so on. So, eventually you would have 5 combo boxes with different names and 5 different phone numbers beside them.

    Now, whenever I select something in one combo box, it changes all the phone number fields for each.

    Thanks!

    Working w/ this code for the first combo box:

    Private Sub qname_AfterUpdate()
    Dim MyName As DAO.Recordset
    Set MyName = Me.RecordsetClone


    MyName.FindFirst "[FoodName] = '" & Me.qName & "'"
    If MyName.NoMatch Then
    MsgBox "Name Not Found"
    Else
    Me.Bookmark = MyName.Bookmark
    End If
    End Sub

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Niki, some questions...

    The code you posted:

    Private Sub qname_AfterUpdate()
    Dim MyName As DAO.Recordset
    Set MyName = Me.RecordsetClone
    MyName.FindFirst "[FoodName] = '" & Me.qName & "'"
    If MyName.NoMatch Then
    MsgBox "Name Not Found"
    Else
    Me.Bookmark = MyName.Bookmark
    End If
    End Sub

    ... checks to see if there is corresponding data in your form's recordset. If there isn't, it displays a MsgBox, if there is, you navigate to a particular record on your form.

    I didn't see anything about a phone number. So, is there other code?

    Also, what is in the Control Source property of the phone number text box?

    Lastly, if you can provide the purpose of the five combos and list their respective properties, more specific help could be provided.

    All the best,

    Jim

  3. #3
    Niki is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    32
    Sry - I thought "phone number" would be easier to explain if there were a quick answer to my question. What I'm trying to do is create a form where recipe ingredients are able to be selected from the combo box and the nutritional information would then be displayed from the clone. Then I would like to add up all the nutritional information for each ingredient and have the total calories, vitamin A, calcium, etc listed for the recipe. So, all combo boxes & text boxes would have the same source table, which is why all fields change when you change one box....

  4. #4
    Niki is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    32
    I've attached the db here. There's a lot of clutter, but if you look at the form Recipe (not Recipes) and try to change the ingredients in the first combo box then you'll see what my issue is.

    Thank you!!

  5. #5
    Niki is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    32

    Some progress...

    I've made some progress on the db, but still can't get multiple clones to work. Please see recipe 7 on the attached recipes form. When you select the combo box, it changes things it's not supposed to change...

    Thanks in advance for any help,

    Niki

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    The thing is that you are moving to the record which you are selecting the option for with the combo. So it would go to the record and then the bound fields would be changing based on which record you were on. The form has ONE recordsource. When you set its bookmark, it will move to that record.

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

Similar Threads

  1. Recordset not updatable
    By Ogian in forum Forms
    Replies: 3
    Last Post: 10-20-2010, 12:08 AM
  2. Using a string to DIM a Recordset
    By ColPat in forum Programming
    Replies: 10
    Last Post: 09-25-2010, 03:53 PM
  3. join key not in recordset - what does it mean?
    By geophilus in forum Queries
    Replies: 1
    Last Post: 08-22-2010, 09:32 AM
  4. Replies: 1
    Last Post: 11-13-2009, 03:03 AM
  5. The Recordset is not updatable
    By bullet_proof302 in forum Access
    Replies: 2
    Last Post: 11-07-2009, 12:13 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