Select Add new record in List box?

G

Guest

I have a listbox, based on a query, with a list of treatments. Is it possible
to have at the end of this list a "*" or "Add New Record" option to select?
If one was to select it and then click the button that accompanies the
listbox, a form would be opened in the add mode instead of the edit mode.
Thanks,
LVer
 
G

Guest

It is possible to do what you ask by creating a table to store additional
options then using a UNION query as the data source of your list box. You
would have to use the SelectedItem method of the listbox to determine which
item is selected.

A simpler way of doing this is to just open the form you mention using the
DoubleClick event of the listbox. Then, it doesn't matter which item is
selected, the form will open anyway...

If you open the form in Dialog mode, once you have finished your editing you
can requery the listbox in the next line, for example:

DoCmd.OpenForm "myForm", , , , ,acDialog
myListbox.Requery

Steve
 

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