Results 1 to 4 of 4
  1. #1
    JessicaNicole is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Washington
    Posts
    8

    Combo Box to Update Tabbed Information ona Form

    I'm working with Access 2007 and am trying to make a form with multiple tabs that will update when a certain business name is selected in the combo box at the top of the form. I have tried looking up different codes to make the combo box update correctly but can't find anything. Right now I have this code in my After Update:

    Private Sub cboBusinessName_AfterUpdate()
    On Error GoTo myError
    Dim rst As Object

    Set rst = Me.RecordsetClone
    rst.FindFirst "[GrowerID] = " & Me.cboBusinessName
    Me.Bookmark = rst.Bookmark

    leave:


    If Not rst Is Nothing Then Set rst = Nothing
    Exit Sub
    myError:
    MsgBox "Record Not Found"
    Resume leave
    End Sub

    Here is a picture of the tabs and combo box.

    Click image for larger version. 

Name:	Access.jpg 
Views:	7 
Size:	121.2 KB 
ID:	9000



    If anyone can help that would be great. Feel like I've been trying to work on this one for too long.

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    JessicaNicole - The code you displayed simply navigates to the record that matches the selection made in the combo. If the additional tabs contain controls/fields from the same recordset (table/query), they should update automatically after the navigation occurs. Evidently, that is not occurring?

    In which case, I would try something like:
    Private Sub cboBusinessName_AfterUpdate()
    On Error GoTo myError

    Dim rst As Object
    Set rst = Me.RecordsetClone 'I have also seen it as Set rst = Me.Recordset.Clone
    rst.FindFirst "[GrowerID] = " & Me.cboBusinessName.Value 'Assumes GrowerID is the bound column of the combo, if not change.
    If Not rst.EOF then
    Me.Bookmark = rst.Bookmark
    else
    MsgBox "Record Not Found"
    exit sub
    end if
    myerror:
    MsgBox Err.Description
    Exit sub

    End Sub

    All the best,


    Jim

  3. #3
    JessicaNicole is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Washington
    Posts
    8
    Okay I got my combo box to work. But now I'm finding that my GrowerID is off by 1 place. for example, if I choose the second grower on the drop down is shows the first grower's information in the tab. I put a Me.subfrmGrowerInformation.Requery at the end of my after update but it still isn't matching.

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    JessicaNicole -
    I would assume that "Me.subfrmGrowerInformation.Requery" indicates you have subform(s) on the additional tabs. You may want to check the Link Child/Master properties of the subform to make sure GrowerID is listed.

    All the best,

    Jim

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

Similar Threads

  1. Replies: 1
    Last Post: 06-28-2012, 09:57 AM
  2. Combo box requery issue in tabbed form mode
    By michael0610 in forum Access
    Replies: 9
    Last Post: 11-17-2011, 03:22 PM
  3. Replies: 12
    Last Post: 04-18-2011, 08:52 AM
  4. Information in tabbed form
    By dunnmel4 in forum Forms
    Replies: 7
    Last Post: 03-27-2011, 04:32 PM
  5. Problems with list or combo box on tabbed form
    By kydbmaster in forum Forms
    Replies: 0
    Last Post: 02-20-2008, 01:33 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