Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a bound combo box
Message
From
12/09/2001 12:34:41
 
 
To
10/09/2001 16:30:31
General information
Forum:
Microsoft Office
Category:
Access
Miscellaneous
Thread ID:
00554864
Message ID:
00555580
Views:
10
To obtain the index of the selected item in a combobox, use the ListIndex property. So when the user presses post, save the selected employee with:
myInt = me!mycombo.ListIndex
And restore it by assigning the myInt var back to ListIndex for the new record. Also I was thinking, you could use a bookmark for this. With a bookmark you don't worry about somebody else adding an employee in another workstation and throwing your listindex out of synch (that is, if you are reloading the employee table each time).




I tried your suggestion in the following manner. When the user presses post, the listindex is saved to a textbox.
me.text1.value = me.mycombo.listindex
I had to change this to
me.text1.value = me.mycombo.listindex + 1
otherwise I was getting the wrong employee.

Doing that made it work except for the first employee whose list index is 0. When I use any other employee it works ok but if I use the first employee, it doesn't find them when the form refreshes.
Here's to alcohol...the cause of ... and solution to ... all of life's problems - - Homer J. Simpson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform