Using combo box to look at history not working

  • Thread starter Thread starter Pamela via AccessMonster.com
  • Start date Start date
P

Pamela via AccessMonster.com

Hello again;

Got another one driving me nuts! Here is what I'm trying to do. I have a
table that keeps a history of Contact Dates. On my form, I have a combo box
which is resized so the it simply looks like a down arrow next to the history
date field. I thought this would be a neat way to allow the users to view
previous contact dates like they have asked me to allow. I have done this
before for a State lookup box, but can't seem to get this to work.

The combo box ([cmbDateHistory]) gets it's row source from the following
query:

SELECT tblContactDateHistory.ContactDate
FROM tblContactDateHistory
WHERE (((tblContactDateHistory.RecID)=[Forms]![F_Solicitation]![Num]));

I want the combo box to display only the dates for the specific record id,
and it works, until I move to a new record. It then displays the results
from the first record it was clicked on. I have tried requery on the on-
click event, but it still doesn't "requery" for the current record when it is
clicked. :

Private Sub cmbDateHistory_Click()
DoCmd.Requery ([cmbDateHistory])
End Sub

What am I doing wrong? Ugh!
 
Pamela,

Try it on the combobox's Enter event rather than Click, and try it like
this...
Me.cmbDateHistory.Requery
 
This worked. Thanks. I'm still learning VB... One cusiosoty though, the
date is inserted into the table twice...

Steve said:
Pamela,

Try it on the combobox's Enter event rather than Click, and try it like
this...
Me.cmbDateHistory.Requery
Hello again;
[quoted text clipped - 23 lines]
What am I doing wrong? Ugh!
 
Back
Top