Results 1 to 7 of 7
  1. #1
    gopher is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    3

    Using a combo box to open a form in edit

    I had a form that has a combo box that I could open and click on a member whose data I need to change. This form worked perfectly until after an automatic "Office" update occurred. Now the form returns the name in the combo box but does not fill in the form such that I can make needed changes. I can cycle through all the names until I find the name I need to change, but that is a pain in the a**. What happened?

    The code used is where "qname" is the name of the unbound combo box which when I click on it should return the form with all the data on it. I tried the system restore. This did not cure the problem.

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


    Me.Bookmark = MyName.Bookmark

    End If
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    That is odd. Have you tried Compact & Repair?

    What are properties of the combobox? RowSource, ColumnCount, ColumnWidths, BoundColumn

    Why use LastName instead of ID for search? What if there are multiple members with same last name?

    It isn't necessary to declare and set DAO recordset object.

    Private Sub qname_AfterUpdate()
    With Me.RecordsetClone
    .FindFirst "[LastName] = '" & Me.qname & "'"
    If .NoMatch Then
    MsgBox "Name Not Found"
    Else
    Me.Bookmark = .Bookmark
    End If
    End With
    End Sub
    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
    gopher is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    3
    I tried compact and repair on the computer at home - No go. Then I tried a different approach. I created a new DB using the table and form. The table of the new db worked as before until, because the close button did not work, I deleted the closed button and created a new closed button. Then the closed button worked ok but the form did not return the data when I tried it again. One more thing I took my flash drive to the club's computer where everything from the original worked fine. The pc at the club has W8 where my home pc is W7. I think the "compact & repair should have worked but it did not. There is something else at play here and I am not sure I'll be able to solve it. Any off the wall suggestions? Cause I am about to throw it all against the wall.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Maybe reinstall Access or even W7?
    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.

  5. #5
    gopher is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    3
    I have been thinking that would be my next step. But, what a pain a W7 reinstall will be. I'll try Access first. An off the wall question first. In Access 2010 what replaced "MS DAO 3.6 Object Library" and can I use it's replacement with the code I submitted initially?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Review http://allenbrowne.com/ser-29.html. Same library and the original code should work as is, although declaring DAO recordset object is not necessary to use recordsetclone in this procedure.
    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.

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by gopher View Post

    ...The table of the new db worked as before until...I created a new closed button then...the form did not return the data when I tried it again...
    A new quirk in Access (like it needed another quirk!) that has appeared, fairly recently, on a number of forums, involves code/macros running, when switching from Design View to Form View, but not running if the Form is then closed and re-opened directly in Form View! It turns out that the Redmond developers assumed that if your are working from 'inside' Access, as it were, you were 'trust-worthy,' so code will run, even if the Folder holding the file hasn't been declared as a 'Trusted' site! But when opened directly, that Folder needs to have that 'Trusted' attribute in place.

    Maybe the Office update has de-certified the 'Trusted' status; I'd check that and reset it, if necessary.

    Linq ;0)>

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

Similar Threads

  1. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  2. Replies: 1
    Last Post: 08-24-2012, 06:50 AM
  3. Replies: 1
    Last Post: 02-01-2012, 01:27 AM
  4. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  5. Combo-box to select item to edit in Form
    By DHavokD in forum Forms
    Replies: 7
    Last Post: 06-05-2009, 01:39 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