Combo Box Always Re-Queries

IHeartA2K

Registered User.
Local time
Today, 12:35
Joined
Jun 16, 2005
Messages
10
So, I am a total newbie with a question that probably has an easy solution. I have a combo box on a form that is populated from a query. The issue is everytime I click on the combo box, it runs the query to populate it. This wouldn't be so bad if it wasn't querying like 500 employee numbers.
Please help.
Thanks!
 
Is there a reason you are running the Query every time you click on it. Are multiple instances being used and the data within the combobox is being updated minute by minute ?

Have you tried to Requery it instead?
 
That is the thing. I am not too sure why it requeries every time I hit the drop down box. It seems like there should be on query run to populate the combo box the first time I click on it and that should be it.
What will the "requery" do that you are speaking of?
 
Here is the code for the combo box:
Private Sub cboDiv_AfterUpdate()

Me!cbodate = Null
Me!cbodate.Requery
DoCmd.RunCommand acCmdRefresh
End Sub

Private Sub cboDiv_Change()
Me.cboDiv.Dropdown
End Sub
 
I was thinking of something along your lines as well.

Private Sub cboDiv_GotFocus ()

Me!cboDiv.Requery

End Sub

I used a table with over 2000 entries and it was nearly unoticeable the requery. I updated a text field, and it was populated within the combobox as soon as I clicked on it. If I might ask, how fast is the machine you are using.

if you do not want to requery everytime , place a command button next to the combobox as a "Refresh" button. It sounds though that this data will not be updated on a regular basis. Only update it when you really need. Every time you start the database, it will be updated.
 
Thanks for the help guys. This forum has been the best Access resource that I have come across.
 

Users who are viewing this thread

Back
Top Bottom