Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / August 2007

Tip: Looking for answers? Try searching our database.

Select Add new record in List box?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LVer - 31 Aug 2007 19:46 GMT
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
SteveM - 01 Sep 2007 00:50 GMT
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

> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.