Results 1 to 9 of 9
  1. #1
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14

    updating a drop down list

    I have a form where you pick a course name from a drop down list. Next to it I created a button that opens for a form with courses names where you can add a new one. Then I save the new course name and close the form. The thing is - the new name doesn't show on the original drop down list until I reopen the form. Is it possible to do something that it actually appears straight away?

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You can try using Me.Requery - on the Form when you want all the new data to be available.

    That should refresh all the controls on the Form and pull in the new course.

    For information on this command, there is a good description here:
    http://office.microsoft.com/en-us/ac...56400.aspx#BM4

    I hope this helps!!

  3. #3
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14
    Robeen,
    Thanks for the link. I tried adding the code but it doesn't work. It work's when I clik SHIFT+F9 but this is not good enough...

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Where did you put the code?
    In what Event of which Form?

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    What exactly does this mean? but it doesn't work

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Try this:

    Code:
     
    Me.Your_ComboBox_Name_Here.Requery

  7. #7
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14
    Quote Originally Posted by orange View Post
    What exactly does this mean? but it doesn't work
    It means that the new entry doesn't appear it the drop down on the main form. And it does after pressing SHIFT F9.

  8. #8
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14
    Quote Originally Posted by Robeen View Post
    Try this:

    Code:
     
    Me.Your_ComboBox_Name_Here.Requery

    Robeen,
    First I put it on the main form / form properties / on got focus and it wasn't working but now I put your new code with the combo box name in the combo box properties and IT DOES THE JOB! Many thanks.

  9. #9
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I'm glad I could help! All the best!

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

Similar Threads

  1. How to get key for drop-down list
    By mitchmcc in forum Access
    Replies: 2
    Last Post: 11-29-2011, 06:21 AM
  2. drop down list
    By slimjen in forum Access
    Replies: 6
    Last Post: 09-15-2011, 01:43 PM
  3. Replies: 4
    Last Post: 06-16-2011, 09:30 PM
  4. drop down list
    By tceicher in forum Access
    Replies: 5
    Last Post: 08-13-2009, 05:41 AM
  5. I can't create a drop-down list box
    By cpuser in forum Access
    Replies: 4
    Last Post: 02-18-2008, 10:11 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