combo box update

  • Thread starter Thread starter g1313
  • Start date Start date
G

g1313

I have a combo box that contains a list of names from a table. I want
to automatically show the next name in the list on each new record and
start at the top of the list when EOF is reached.
 
You're going to need to do some work to make your logic a bit tighter:

What happens if a new record is entered, the combo set up, the user then
changes the combo to another name, and then creates another new record.
Does that get the 'next' one after what it was originally, or the one after
the one it was changed to?

What if a new record is added, then the user goes back to an old record
before entering a new record? 'Next' after which one?

What does 'next' mean? Alphabetical? What happens if a new name is
inserted?

Whatever logic you use, you're going to need a global variable that stores
the 'last' name. When you add a new record (which I think you're going to
need to do via a command button, rather than leaving the default navigation
buttons enabled) just use a function that finds that variable in the
recordset, moves to the next, and returns that name (or returns the 'first'
name if eof)

(...detail purposely missed out as pretty much impossible to put together
until you come up with answers to the first questions.)

Out of interest, why do you want to do this?
 
I will try to make this clearer: I have two tables: one table holds the
records(Log Table) the other is the table(Name Table) used for drop
down. This table has 13 names listed in alpha. order. I want the
program to open to a new record each time it opens and display the next
name in the combo box. Because the form is linked to "Log Table" the
record will be written to "Log Table" When EOF is reached in "Name
Table" it should display the first name. This program is used to assign
clients to persons in "name table"
 
Yup. I assumed that that was the kind of thing that you were trying to do.
Does the idea of storing the 'last' name and then using a function to find
the 'next' one make sense?
 
Back
Top