If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Drop down list
In my form I have a drop down lists that lists all the office supply
products. My question is: How do I get the drop down lists to display only those products which have not been discontinued? In my main table their is a yes/no field if a product has been dicontinued. Thanks. |
#2
|
|||
|
|||
Drop down list
Base your drop-down list on a query that only finds the products not
discounted. Regards Jeff Boyce Microsoft Office/Access MVP "Mya48" wrote in message ... In my form I have a drop down lists that lists all the office supply products. My question is: How do I get the drop down lists to display only those products which have not been discontinued? In my main table their is a yes/no field if a product has been dicontinued. Thanks. |
#3
|
|||
|
|||
Drop down list
Something like:
SELECT ProductsTable.ProductID, ProductsTable.ProductName, ProductsTable. Discontinued FROM ProductsTable WHERE (((ProductsTable.Discontinued)=0)); -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
Drop down list
Thank you very much, it works great.
"Linq Adams via AccessMonster.com" wrote: Something like: SELECT ProductsTable.ProductID, ProductsTable.ProductName, ProductsTable. Discontinued FROM ProductsTable WHERE (((ProductsTable.Discontinued)=0)); -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via http://www.accessmonster.com |
#5
|
|||
|
|||
Drop down list
Sorry to bother you again but would this work on a report as well?
"Linq Adams via AccessMonster.com" wrote: Something like: SELECT ProductsTable.ProductID, ProductsTable.ProductName, ProductsTable. Discontinued FROM ProductsTable WHERE (((ProductsTable.Discontinued)=0)); -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via http://www.accessmonster.com |
#6
|
|||
|
|||
Drop down list
On Tue, 31 Mar 2009 15:58:01 -0700, Mya48
wrote: Sorry to bother you again but would this work on a report as well? Yep. Just try it g -- John W. Vinson [MVP] |
#7
|
|||
|
|||
Drop down list
I entered this into the code but it doesn't do anything, any suggestions?
Private Sub Report_Open(Cancel As Integer) On Error Resume Next Me![ProductName].Controls = Me![ProductName] Me.[ProductName].Object = Not (((Products.Discontinued) = 0)) End Sub "John W. Vinson" wrote: On Tue, 31 Mar 2009 15:58:01 -0700, Mya48 wrote: Sorry to bother you again but would this work on a report as well? Yep. Just try it g -- John W. Vinson [MVP] |
#8
|
|||
|
|||
Drop down list
On Wed, 1 Apr 2009 14:18:15 -0700, Mya48
wrote: I entered this into the code but it doesn't do anything, any suggestions? Private Sub Report_Open(Cancel As Integer) On Error Resume Next Me![ProductName].Controls = Me![ProductName] Me.[ProductName].Object = Not (((Products.Discontinued) = 0)) This has absolutely NO relationship to anything I've seen in the thread, and it doesn't make any sense to me. The Controls collection is a collection of the controls (textboxes, combos, etc.) on a Form or Report. What is this code intended to accomplish? -- John W. Vinson [MVP] |
#9
|
|||
|
|||
Drop down list
All I was trying to accomplish was for my report to show only the products
that are available not discontinued. You gave me this code for the form and it works great. SELECT ProductsTable.ProductID, ProductsTable.ProductName, ProductsTable. Discontinued FROM ProductsTable WHERE (((ProductsTable.Discontinued)=0)); but I guess I don't know where to put it on the report because there is no row source on the properties of the field like there is on the form. "John W. Vinson" wrote: On Wed, 1 Apr 2009 14:18:15 -0700, Mya48 wrote: I entered this into the code but it doesn't do anything, any suggestions? Private Sub Report_Open(Cancel As Integer) On Error Resume Next Me![ProductName].Controls = Me![ProductName] Me.[ProductName].Object = Not (((Products.Discontinued) = 0)) This has absolutely NO relationship to anything I've seen in the thread, and it doesn't make any sense to me. The Controls collection is a collection of the controls (textboxes, combos, etc.) on a Form or Report. What is this code intended to accomplish? -- John W. Vinson [MVP] |
#10
|
|||
|
|||
Drop down list
On Thu, 2 Apr 2009 07:28:01 -0700, Mya48
wrote: All I was trying to accomplish was for my report to show only the products that are available not discontinued. You gave me this code for the form and it works great. SELECT ProductsTable.ProductID, ProductsTable.ProductName, ProductsTable. Discontinued FROM ProductsTable WHERE (((ProductsTable.Discontinued)=0)); but I guess I don't know where to put it on the report because there is no row source on the properties of the field like there is on the form. Use the same Query *As the recordsource for the Report*. This has nothing to do with the properties of a field or of a control. My suggestion is to change where the report gets its data. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|