PC Review


Reply
Thread Tools Rate Thread

Add a "<Add New>" value to a combo box dropdown list.

 
 
=?Utf-8?B?UklQ?=
Guest
Posts: n/a
 
      20th Jun 2005
I need help adding a "<Add New>" value to a combo box... My form has 2 combo
boxes.

One named "make" displays makes of vehicles, & one named "model" displays
models.

The values of "model" are contingent upon the value of "make". Whenever I
change the value for "make", a DoCmd.Requery "model" takes place.

The criteria of the query limits the results to those where both tables are
equal, and unless I add a "<Add New>" to every make, I am unable to get the
"<Add New>" to come up on the dropdown list for "model".

I tried adding the "<Add New>" to the underlying table for "model" , but it
gets filtered out of values for the list.

Thanks in advance
Walter
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      21st Jun 2005
"RIP" <(E-Mail Removed)> wrote in message
news:2FA03D37-E41E-4FB7-93D7-(E-Mail Removed)
> I need help adding a "<Add New>" value to a combo box... My form has
> 2 combo boxes.
>
> One named "make" displays makes of vehicles, & one named "model"
> displays models.
>
> The values of "model" are contingent upon the value of "make".
> Whenever I change the value for "make", a DoCmd.Requery "model" takes
> place.
>
> The criteria of the query limits the results to those where both
> tables are equal, and unless I add a "<Add New>" to every make, I am
> unable to get the "<Add New>" to come up on the dropdown list for
> "model".
>
> I tried adding the "<Add New>" to the underlying table for "model" ,
> but it gets filtered out of values for the list.
>
> Thanks in advance
> Walter


Use a Union query as the rowsource of the combo box, using a technique
similar to that described on this page:

http://www.mvps.org/access/forms/frm0043.htm
Forms: Adding "All" to a listbox or combobox

That's talking about adding "all" to the list, but it should be easily
to adapt it to add "<Add New>".

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
John Spencer (MVP)
Guest
Posts: n/a
 
      21st Jun 2005
Are you using a query as the basis of your combobox?

Try using a UNION Query.

For example,

SELECT ModelName
FROM YourModelTable
WHERE YourModelTable.Make = Forms!Formname!Comboname
UNION
SELECT "<Add New>"
FROM YourModelTable



Th

RIP wrote:
>
> I need help adding a "<Add New>" value to a combo box... My form has 2 combo
> boxes.
>
> One named "make" displays makes of vehicles, & one named "model" displays
> models.
>
> The values of "model" are contingent upon the value of "make". Whenever I
> change the value for "make", a DoCmd.Requery "model" takes place.
>
> The criteria of the query limits the results to those where both tables are
> equal, and unless I add a "<Add New>" to every make, I am unable to get the
> "<Add New>" to come up on the dropdown list for "model".
>
> I tried adding the "<Add New>" to the underlying table for "model" , but it
> gets filtered out of values for the list.
>
> Thanks in advance
> Walter

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable dropdown list (Combo box -"Form control") =?Utf-8?B?Vmlub2Q=?= Microsoft Excel Worksheet Functions 1 5th Nov 2007 06:01 PM
Still not working - ".SetFocus" on a form element and then havingthe combo box ".Dropdown" CES Microsoft Access Forms 7 17th Jan 2007 12:07 PM
Still not working - ".SetFocus" on a form element and then havingthe combo box ".Dropdown" CES Microsoft Access VBA Modules 4 16th Jan 2007 09:28 PM
Still not working - ".SetFocus" on a form element and then havingthe combo box ".Dropdown" CES Microsoft Access Form Coding 4 16th Jan 2007 09:28 PM
".SetFocus" on a form element and then having the combo box ".Dropdown" CES Microsoft Access Forms 2 14th Jan 2007 11:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:22 PM.