Combo Box Help

  • Thread starter stainless steel
  • Start date
S

stainless steel

Please someone help me. I want to set up a combo box with a list of names for
future use.Since I wouldn't know all the names right away,( I can not create
a table with the names) I want so each time I add a new name to the list it
will be there so the next time I come across that same name I can just select
it from the drop down list instead of entering it again.
 
J

June7

Aren't the selected names saved as data somewhere? Set the combobo
RowSource to query this field: SELECT DISTINCT thenamesfield FRO
sometablename ORDER BY thenamesfield
Set LimitToList property to No. If you want to see that new name in th
list immediately then in the combobox AfterUpdate event
Me.combboxname.Requery

Also, other properties available that allow you to deal with new items
You can use AllowValueListEdits and ListItemsEditForm to add new entrie
to a table. Otherwise you have to use the OnNotInList event to modif
the ValueList property and then save the form with this edit. The ris
here is that if you have code that changes other properties of the for
or controls based on some conditions when the form opened they will als
be saved (such as the display of some controls). How many names are yo
dealing with. Why can't you have a table of names? Why does it matter i
they are in the ValueList or in a table
 
S

stainless steel

Thanks. well the names aren't saved anywhere. This is a databse I am trying
to set up for book rented from the library. So there will be different author
from time to time, and possibly one author will have more than one books.
I was wondering if it at all possible to set it up in a way that whenever I
check out a book with the same author again, I don't have to type it in again
but can just select it fom the previuos time I entered it.
Because I am trying to set the database up to open in the books form and
have the author as a subform.
 
J

June7

If you want the database to 'know' any title you have entered in th
past, will have to save the values somewhere. It is simple enough t
build a table, bind it to a form, add controls to the form, bind th
controls to fields.

Use an unbound combobox as a search tool. Set its RowSource with (se
AutoExpand property to Yes):
SELECT DISTINCT titlesfieldname FROM bookstablename ORDER B
titlesfieldname
Then if record already in table use code to go to that record on sam
form or open another form to display just that record. Then in boun
controls you enter data which will save directly to table.

If you need tutorial on Access, here is a good start.
'aspfree.com: access-tutorial-videos' (http://tinyurl.com/mr7wzt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top