Results 1 to 3 of 3
  1. #1
    pratim09 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    30

    Combo box prob - little urgent

    I have 2 combobox in a form . cmb1 and cmb2 . On the cmb1 on change event i am populating the values of cmb2 according to sql query in code. First time the cmb2 values populates correctly .Also on change property of cmb2 populates other values in the form.



    The problem is 2nd time when I select cmb1 for some other value the cmb2 retains the values of the first cmb1 search along with the new ones for the recent cmb1 value.Ideally it should show the new values only.

    How do i get rid of these. Attached is a sample.

  2. #2
    free_style is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    4
    Quote Originally Posted by pratim09 View Post
    I have 2 combobox in a form . cmb1 and cmb2 . On the cmb1 on change event i am populating the values of cmb2 according to sql query in code. First time the cmb2 values populates correctly .Also on change property of cmb2 populates other values in the form.

    The problem is 2nd time when I select cmb1 for some other value the cmb2 retains the values of the first cmb1 search along with the new ones for the recent cmb1 value.Ideally it should show the new values only.

    How do i get rid of these. Attached is a sample.
    Hello friend,

    The problem is that you have to make Requery of the form you use.
    Try to add event "After update" on the first combo box - cmb1:

    Code:
    Me.Requery
    Then everything should be work fine!

    Best wishes

  3. #3
    pratim09 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    30
    Thanks for the reply .I tried doing a requery on the form on the after update event of cmbbox 1 but its still not working.The previous values are still showing.I have attached my sample app in the previous post ,if u need.

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

Similar Threads

  1. Technical Prob for Newb...
    By westphi in forum Database Design
    Replies: 3
    Last Post: 03-21-2011, 11:37 AM
  2. Replies: 1
    Last Post: 07-27-2010, 07:06 AM
  3. Concatenation Urgent Help
    By Shoaib in forum Queries
    Replies: 0
    Last Post: 04-23-2009, 11:02 PM
  4. noob prob, generating next report
    By flash319 in forum Reports
    Replies: 2
    Last Post: 08-04-2008, 03:10 PM
  5. I need help! Urgent! :(
    By Suzan in forum Database Design
    Replies: 0
    Last Post: 04-08-2006, 11:58 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