Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Access (https://www.askmehelpdesk.com/forumdisplay.php?f=441)
-   -   Adding customer (https://www.askmehelpdesk.com/showthread.php?t=23650)

  • Mar 29, 2006, 05:38 PM
    jduke44
    Adding customer
    I have been learning and building an ms access database. There version is 2002. I have all my tables built and the forms built. I wanted to be able to add a customer so that it would get included in a drop down box. I can add it the problem is I have to close the form and reopen it so I can see it in the list. Would I have to add code to get this to update automatically or is there something within the properties? Thanks.
  • Apr 4, 2006, 06:36 AM
    ScottGem
    You need to requery the combobox after you add the customer. The code would be:

    Me.comboboxname.requery

    But where you put it depends on your work flow.
  • Apr 7, 2006, 03:04 PM
    jduke44
    Scott, thanks for responding. As you know I am just learning Access so bare with me. I uderstand I am vague in what my project is but when you say to add the code you provided are talking to place it in an event procedure?

    If so what would be my choices? Would I add it under the event tab where it has After Update and so forth. The I would want to build a code? I tried it in different places but it didn't work. I want to learn this on my own (with a little help) so doing it wouldn't be beneficial but if you point me in the right direction, I'm sure I can figure it out. Thanks for your time.
  • Apr 7, 2006, 07:01 PM
    ScottGem
    Access is an event driven platform. Code is triggered by events like the update of a control the press of a button, etc. You need to look through the flow of how you are adding a new customer. Somewhere after you add the customer to the table, you need to requery the combo.
  • Apr 7, 2006, 07:48 PM
    jduke44
    Scott, I think I figured it out thanks to you. After placing the code in various events it worked under the "on Got Focus " event. So I assume once the combobox received control it would requery. I think I am understanding it a little. I might have more questions later. Thanks for your help.
  • Apr 8, 2006, 05:00 AM
    ScottGem
    The Got Focus event was certainly a possibility. There were probably a couple of different places you could have put it and have it work.
  • Apr 11, 2006, 05:57 PM
    jduke44
    It works and I'm happy. As I learn Access I'll hopefully find the more efficient way of doing things. That is if I do any more databases. It's been somewhat fun learning this. I'll probably have more questions in the future. Thanks for your help.
  • Apr 12, 2006, 05:14 AM
    ScottGem
    Glad to assist

  • All times are GMT -7. The time now is 05:26 AM.