Question
 | |  | | | 
Mar 29, 2006, 03:38 PM
| | Full Member | | Join Date: May 2005
Posts: 401
| | | adding customer I have been learning and building an ms access database. Ther 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. | | | | | | |
Answers
 | |  | | |
Apr 4, 2006, 05:36 AM
|
#2
| | | Computer Expert
Join Date: Jan 2003 Location: LI, NY - USA
Posts: 21,820
Pay to call ScottGem for advice ($.75/min) | 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, 02:04 PM
|
#3
| | Full Member
Join Date: May 2005
Posts: 401
| 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, 06:01 PM
|
#4
| | | Computer Expert
Join Date: Jan 2003 Location: LI, NY - USA
Posts: 21,820
Pay to call ScottGem for advice ($.75/min) | 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 thru 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, 06:48 PM
|
#5
| | Full Member
Join Date: May 2005
Posts: 401
| 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 recieved 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, 04:00 AM
|
#6
| | | Computer Expert
Join Date: Jan 2003 Location: LI, NY - USA
Posts: 21,820
Pay to call ScottGem for advice ($.75/min) | The Got Focus event was certainly a possibilty. There were probably a couple of different places you could have put it and have it work. |
| | | | | | |  | |  | | |
Apr 11, 2006, 04:57 PM
|
#7
| | Full Member
Join Date: May 2005
Posts: 401
| 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, 04:14 AM
|
#8
| | Computer Expert
Join Date: Jan 2003 Location: LI, NY - USA
Posts: 21,820
Pay to call ScottGem for advice ($.75/min) | Glad to assist |
| | | | | | | | Question Tools | Search this Question | | | | | Display Modes | Linear Mode | |