Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AfterUpdate() vs. Click()

Status
Not open for further replies.

Compuboy

Programmer
Jun 8, 2004
38
US
MICROSOFT ACCESS
The situation is: I have a listbox that lists cord blood ID #'s. When an item is selected from this list, information (such as Date, Type, etc.) are displayed in text boxes; this is taken directly from the table, I made it with a wizard. You can also select a date from the combo boxes and only the blood samples from that date will appear in the listbox. Or you can press a sort button and it will sort the blood samples by date.

When I open the form or update the listbox (either by the date combobox or sort button), I select the first item in the listbox by:

If CordLB.ListCount > 0 Then
CordLB.SetFocus
CordLB.ListIndex = 0
End If

It always selects the first item but the PROBLEM IS when the first item is selected under the Sort_Click() function, the information in the text boxes change to the info of the currently selected item; the first one. THIS is GOOD. However, when the first item is selected under Date_AfterUpdate(), the first item is highlighted but the information in the text boxes does not change. It just stays the same, until I actually click on the item in the listbox. Dunno why the same code does different things in AfterUpdate() and Click().

DO you know how I can get the information in the text boxes to automatically update after I select the fist item in the AfterUpdate() function?? THANKS.
 
Hallo,

Not totally sure what you mean. Could you show your code and explain the form again,

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top