Results 1 to 6 of 6
  1. #1
    lynthel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    30

    after update Event Procedure not updating form

    I have a form with a combo box drop down menu...I am having a couple issues...



    1. (referring to code below) After Update is not updating form. I want the form to populate with the info about the selected item from the combo box.
    #1 has been solved!

    2. How do I refresh the drop down list while form is open after a new record has been created and added?
    #2 has been solved!

    3. Can I add an item "New Program" at the top of the drop down menu that will focus on a text box on the form to have user input new program info?

    lst_program_query is drop down list combo box


    Code:
    Private Sub lst_program_query_AfterUpdate()
        On Error Resume Next
        Dim rst As Object
        Set rst = Me.RecordsetClone
        rst.FindFirst "[tiw_program_no]=" & Me.lst_program_query.Value
        Me.Bookmark = rst.Bookmark
    End Sub
    Last edited by lynthel; 04-21-2014 at 12:01 PM. Reason: update

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Here is an example that finds a match for a value that is literal text. It saves the current record, in case that matters and it uses the Bookmarkable property to evaluate the record's ability to bookmark.

    https://www.accessforums.net/forms/e...tml#post208679

  3. #3
    lynthel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    30
    Quote Originally Posted by ItsMe View Post
    Here is an example that finds a match for a value that is literal text. It saves the current record, in case that matters and it uses the Bookmarkable property to evaluate the record's ability to bookmark.

    https://www.accessforums.net/forms/e...tml#post208679
    I tried using the snippet to test...however, in my case, the query that the combo box calls on has three columns, and the third column, that is the primary key, is hidden. When trying to adjust the code for my situation (using column 2 as third column and using correct field name), I get a mismatch error...

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    This is for text
    rs.FindFirst "[cust_name] = '" & Me.ComboboxName.Column(0) & "'"

    this is for numbers
    rs.FindFirst "[cust_name] = " & Me.ComboboxName.Column(0)

  5. #5
    lynthel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    30
    Thank you...this helped to solve #1 and #2 above...now to see if I can find an answer for #3.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You can add a record to the table that is the RowSource of your combo and then include an afterupdate event handler for the combo

    If me.combo = 1 then
    Do Something here
    end if

    I would use a separate control button that had a click event to add a record/item to the data set or value list of the combo.

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

Similar Threads

  1. Form Event Procedure
    By Jgk in forum Forms
    Replies: 7
    Last Post: 03-30-2014, 04:31 PM
  2. Replies: 1
    Last Post: 03-29-2014, 07:46 PM
  3. Replies: 3
    Last Post: 05-07-2012, 12:17 PM
  4. 'After update' Event procedure
    By sk88 in forum Access
    Replies: 5
    Last Post: 08-30-2011, 02:51 PM
  5. Replies: 1
    Last Post: 07-08-2011, 10:26 AM

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