f



Making a form control the criteria for the sql statement of another control (Access 2003)

I have two comboboxes on a form. Combobox1 uses field1 in another table
as its source of data. What I want to do is to enable combobox2 to use
field2 in that table, but only to show the rows of data that contain
the item selected in combobox1.

At the moment I can easily write a SQL statement with a WHERE clause,
but I only know how to specifiy static criteria. What I want is a
variable criteria, where the criteria is the data contained in combobox
1. 

Is this possible?

thanks for any help :)

Ste

0
google129 (3)
11/20/2006 7:49:28 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

1 Replies
430 Views

Similar Articles

[PageSpeed] 28

"SteMc" <google@jasmonio.supanet.com> wrote
>I have two comboboxes on a form. Combobox1 uses field1 in another table
> as its source of data. What I want to do is to enable combobox2 to use
> field2 in that table, but only to show the rows of data that contain
> the item selected in combobox1.
>
> At the moment I can easily write a SQL statement with a WHERE clause,
> but I only know how to specifiy static criteria. What I want is a
> variable criteria, where the criteria is the data contained in combobox
> 1.

In the AfterUpdate event of ComboBox1, specify the Row Source of ComboBox2 
as a SELECT query.  So if the first combo selects the state, then the second 
combo of cities is filtered by that state:

Private Sub cboState_AfterUpdate()
   Me!cboCity.RowSource = "SELECT city_id, cty_name FROM city WHERE 
city_state = ' " & Me!cboState & " ' "
   Me!cboCity.Requery
End Sub

-- 
Darryl Kerkeslager 


0
kerkeslager (601)
11/20/2006 9:05:09 PM
Reply:

Similar Artilces:

Access Controls in Access
How on access can you set access controls to your users? If they log in with one username and password they can just read information and if they log in with another username and password they can read and write? I have no idea how to do this, is it even possible?? Thank you Try playing with the access security tool, you can add users, groups, passwords, read/write allowances etc. to your database using that. Its under the 'Tools' menu of Access. Brian wrote: > Try playing with the access security tool, you can add users, groups, > passwords, read/write allowances etc. to your database using that. > Its under the 'Tools' menu of Access. Playing is not the proper word for it. I would never "play" with installing security without a backup copy of the System.mdw file or a backup of the application. You should also recommend the SecFaq when "playing" with security. http://www.mvps.org/access/resources/techpapers.htm. Dangerous http://www.youtube.com/watch?v=ASIVv_LiBoU Yeah i suppose playing wasn't the correct word for it. Hey Thanks for both your help. I'll try that. "Hanny J" <hannyjones@aol.com> wrote > Thanks for both your help. I'll try that. Note that a well-versed author and authority, Roger Jenkins, back in the days of Access 2.0, characterized Access' Security as "labrynthine". It has not gotten any less complex, and I caution that, while it is "doable&qu...

Running a ms access database with access 2003 in Vista
I have a Database that I am trying to run on a new vista computer. Up to now I was running it on a win 98 computer and using access 2003! I installed access 2003 and I can make it run and view the data but I can not save any new records. Has any one seen this problem yet? Thanks Clarence Wollman On Wed, 22 Aug 2007 13:17:13 -0700, cwoll <clarencewollman@gmail.com> wrote: Do you have the same problem with the Northwind sample application? (search your computer for northwind.mdb) -Tom. >I have a Database that I am trying to run on a new vista computer. Up >to now I was running it on a win 98 computer and using access 2003! I >installed access 2003 and I can make it run and view the data but I >can not save any new records. >Has any one seen this problem yet? > >Thanks Clarence Wollman On Aug 22, 7:29 pm, Tom van Stiphout <no.spam.tom7...@cox.net> wrote: > On Wed, 22 Aug 2007 13:17:13 -0700, cwoll <clarencewoll...@gmail.com> > wrote: > > Do you have the same problem with the Northwind sample application? > (search your computer for northwind.mdb) I don't have a problem opening and editing the northwind.mdb. Thanks Hi I found a workaround. This database has a fronted and a backed. When I link them in the linked table manager, I was going threw the network to my computer. The reason I am doing this is when any networked computer opens the shortcut to the front end of this computer the linked table manger knows...

Error looping through controls on form in Access 2003
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl The error says that the 'Object doesn't support this property or metho, then it highlights the line above ctlBackColor. How can I loop through the controls on a form to check the backcolor and then set it? TD Some controls (such as command buttons) don't have a BackColor property, so you receive error 438 telling you that the property is not supported by that control. T...

sql statement as a control source in Access reports
Hi everyone, I am trying to use the expression builder to create input to a control in an Access report. I have a table called Records and I want to select the minimum date for a record where the student = studentID.. The sql is pretty simple: "Select MIN(RecDate) from records_T where studentID = 1". Now, I have been trying to get this statement to work with the expression builder, but no go!! Is it possible to get this working someho with the expression builder or supplying the SQL directly to the control source property?? Thanks, Anja SQL cannot be used as Control Source; it can be used as Record Source for a Form or Report, and a Field in the Record Source used as Control Source. A Control Source may also be an expression, a constant, or a Function. The DMIN Function may provide the information you want... I'd say chances are slim to none that you actually want to specify the student id as a constant, so you need to determine how you are going to obtain it... you may well need to use VBA code to implement what you want. If you could explain what it is that you have and what you are trying to accomplish, not how you are trying to accomplish it (e.g., "use the expression builder to create a control source"), perhaps someone could be more helpful. Larry Linson Microsoft Access MVP "Anja" <anja.ende@googlemail.com> wrote in message news:1165531502.913010.237720@73g2000cwn.googlegroups.com... > Hi everyone, &g...

Possible to keep MS Access interface and migrate the MS Access to MS SQL Server?
Hello all Would it be possible to migrate the MS Access 2000 to MS SQL Server 2000? My application is using MS Access 2000 as database and as user interface such as forms. Now, I want to migrate the backend database from MS Access 2000 to MS SQL Server 2000. However, I want to keep the MS Access 2000 interface. Would it be possible? If I migrate the MS Access to SQL Server, would the queries, back-end VBA, macro, tables and forms be affected? Do I need to change the MS Access data type to SQL server supported data type? Which tool I can use to do the migration? Upsizing wizard or exporting...

[rfc-dist] RFC 5417 on Control And Provisioning of Wireless Access Points (CAPWAP) Access Controller DHCP Option
A new Request for Comments is now available in online RFC libraries. RFC 5417 Title: Control And Provisioning of Wireless Access Points (CAPWAP) Access Controller DHCP Option Author: P. Calhoun Status: Standards Track Date: March 2009 Mailbox: pcalhoun@cisco.com Pages: 6 Characters: 11551 Updates/Obsoletes/SeeAlso: None I-D Tag: draft-ietf-capwap-dhc-ac-option-02.txt URL: http://www.rfc-editor.org/rfc/rfc5417.txt The Control And Provisioning of Wireless Access Points Protocol allows a Wireless Termination Point to use DHCP to discover the Access Controllers to which it is to connect. This document describes the DHCP options to be used by the CAPWAP Protocol. [STANDARDS TRACK] This document is a product of the Control And Provisioning of Wireless Access Points Working Group of the IETF. This is now a Proposed Standard Protocol. STANDARDS TRACK: This document specifies an Internet standards track protocol for the Internet community,and requests discussion and suggestions for improvements. Please refer to the current edition of the Internet Official Protocol Standards (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. This announcement is sent to the IETF-Announce and rfc-dist lists. To subscribe ...

kb969898 Windows Update Broke MSComm control, maybe other VB controls, in Access 2003
Greetings, Here's a strange one for you. I have an Access 2003 app that uses the MSComm32 ActiveX control (From VB6) to talk to a serial printer. It has worked fine for years, but as of the Windows Update earlier this week (I narrowed it down to kb969898, which is a kill bits update to block malicious behavior by ActiveX controls in IE, but seems to also include VB6 SP6 as well). Links: The kb: http://www.microsoft.com/technet/security/advisory/969898.mspx The VB6 SP6: http://support.microsoft.com/?kbid=957924 During execution of the form with the control, I get Error 438 - 'Object doesn't support this property or method'. (happens on the first line of code that refers to the control, specifically, the .CommPort property, but I think any property or method would trigger the error, see next paragraph) So, I went into design view and then get 'There is no Object in this control'. The control no longer shows as a telephone icon, but blank. I tried these without success: - Re inserting the control - Re registering the control - Adding a reference to the control and using as an object variable instead of as a control - Creating a brand new db and form and adding the control Then on a whim, I tried it in Access 97, and the control works just like before. Removing the update returns functionality to normal. According to the link on the VB SP6, there is a known issue, that is described as being similar (Different wording of the error messa...

Open Form in Ms-Access from a hyperlink by using dhtml control
Hey ! I'm having a little ms-access application problem. in form A I have a dhtml control which I'm trying to assign it's documentHtml property a html string. I want that the html string will contain a hyperlink which open another form in access. Can I do that ? David ...

Making sure MS Access scrolls properly in subforms/controls
Dear forum, In my database, I have one instance where a specific collection of 7 forms are expected all at one time, so I tried to build an entry screen where the entry form for each individual form is present as a subform in a tabcontrol in one main form, to make it easier for my unit's Data Entry Officers. Unfortunately, there seems to be a problem with scrolling that I have been resolve, probably caused either by the tabcontrol or the subforms, since it does not occur when the form which was used as a basis for the subform is opened individually. This problem is that where the indivi...

Create MS/ACCESS database app for non-ms/access users
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Per Sue Bricker: >Is it possible to create an MS/ACCESS database application and package >it for users who do not have MS/ACCESS loaded in their PCs? > >I was told that this is possible, but...

MS Access 2002
MS Access 2002 - query form control returns funny symbols like [][] I am running an append query on a form. Access is having trouble with the calculated fields and comboboxes. Example &#8211; referring to forms!FormName!ControlName within the query should return the value of that control, correct? I am receiving symbols such as boxes [] or [][] as well as Chinese symbols. Any thoughts as to why this is happening. thanks This happens if Access does not understand the data type of the calculated controls. Typecast the calculated fields, and set the Format of unbound controls. For ...

MS Access 2000 VBA Code Shows Totally Incorrect Date from Controls on a Form
Hi, Sorry for my English. English is not my native tougue. I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked tables in it. One of my forms has two TEXT BOX controls formated as Short Date. The form is binded to a linked table. The linked tables has about 7 records and one of the control is binded to a table field. These two controls displays the date correctly as 01/07/2006 and 31/07/2006 (I am running Windows XP, my regional setting is set to English Australia, location is set to Australia, language for non-...

Re: <Another Pluh>Re: Accessing MS SQL server or ORACLE database from the HP3K
From: "PeteVickers" <pete@GUI-INNOVATIONS.COM> > Hi, > forgive the 2nd plug, but we have just uploaded the NewsWire review to the > web site, or use the direct link > http://www.gui-innovations.com/NewsWire0209.pdf > "Paul H. Christidis" <phchristidis@raytheon.com> wrote in message > > Is there a way for an IMAGE/VPLUS based application to connect, extract, > > and present to the user (based on his input) data residing on an MS SQL > > server or an ORACLE database on a different host? <plug> MPE/iX Enterpr...

how to access database control of many oracle10g database instances on same server
I am on Redhat Linux 9 and using Oracle 10G (10.0.1.3?). I know how to create a Oracle database instance and use EM database control to administer the database. To access database control from a browser, Oracle asks to enter a URL: http://server_name:5500/em The URL does not specify the ORACLE_SID. I however want to create several database instances on the same box. Will Oracle automatically set up a different port (e.g., 5501) for second instance. All the documentation I have found on Oracle's web site refers to a single database instance on a server. Appreciate any pointers. Thanks a lot, Prem You need to read about Grid Control. Actually when you create your database using DBCA, it should ask you whether you want to use Grid Control or DB Console. Jining Han Jining Han wrote: > You need to read about Grid Control. Actually when you create your > database using DBCA, it should ask you whether you want to use Grid > Control or DB Console. > > Jining Han I hae read about Grid Control, but I think there is still a way to access many instnaces on the same server using database control. Prem Of course you can, a DB Console for each database, and you can choose that as your preferred approach, too. But I really think it's a waste of resources and a big inconvenience. You are probably better off with the "tradictional" desktop console. Just my 2 cents. Jining Han <premmehrotra@hotmail.com> wrote in message news:...

Making MS Access Form as a standalone form like in VB
Well, its sames difficult for me; I love access so much and wish to make it perform extra task. I prepared an HTML form but can not connect it to my access table and so I think it is possible to make an access form a standalone form for user input. Can anyone assist. My mail add is dianafather@aim.com. *** Sent via Developersdex http://www.developersdex.com *** Oscar, why don't you just code up a VB form for user input and connect it to an Access backend? To my knowledge, you can't force an Access form to exist outside of Access. Your users would have to open the Access file to ent...

MATLAB command to access MS Access database
Hi! Is there a MATLAB command which gives access to a .mdb MS Access database or do I need a special driver? Thanks, Andree Hi Andree Ellert, you can use activeXcontrol to interact with MS-Access database. access = actxserver('Access.Application'); returns the handle for Access. set(access, 'Visible', 1); will show the opened Access window. use get(access) and set(access) commands to find the methods available to call. -Vadivelu M =========== http://www.mathworks.com/access/helpdesk/help/toolbox/database/datatool.shtml "Andree Ellert" <ellert@gmx.net/////\\\\\> wrote in message news:eed9874.-1@webx.raydaftYaTP... > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree Andree Ellert wrote: > > > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4045&objectType=file> -Hardik ...

Access MS-ACCESS database on server from client????
I m currently developing a java based application and want to know how can i make client access database located on the server? "HeMan_Speaks" <Lunar20092010@gmail.com> wrote in message news:d71ce567-0434-48b8-b1d2-bb191706ab45@w8g2000prd.googlegroups.com... >I m currently developing a java based application and want to know how > can i make client access database located on the server? I think you're going to have to expand a little bit more in your question here, as is not 100% quite clear what you're trying to do. You might want to make a little bit of a distinction between MS access, the development system that allows you to write code, build forms, and build reports, and that of the database engine that you choose to use with MS access. When you build an application MS access, you then choose your database engine, that might be oracle, SQL server, or perhaps more often leave the default jet database. So when you say make a client access application, are you talking about a piece of software that you plan to install and each computer? The fact that your introducing the issue of java further complicates your question. Perhaps your question is simply you have some java code running on a server, and with to open a mdb file (an access database file). In this situation you're not really using MS access at all here (you using what is called the jet database engine to read that mdb file). For all the trouble in this type of sce...

request for explanation on access an database in ms access
This is the code that I found on the internet for accessing an ms access database: import java.sql.*; class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // set this to a MS Access DB you have on your machine String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end // now we can get the connection from the DriverManager Connection con = DriverManager.getConnection( database ,"",""); } catch (Exception e) { System.out.println("Error: " + e); } } } What I don't understand is the declaration of database. What I did was putting the database in the same dir as the sourcecode and use "jdbc:odbc:CafeJolt.mdb". But this doesn't work. And the above code does, why is that??? Actually it's not Java question. It's ODBC question. You have to have ODBC connection. Depending of Windows it's usually something like this (for my Windows 2000): Start->Sttings->Control Panel->Administartive Tools->Data Sources(ODBC)-> User DSN -> [Add]-> Driver to Microsoft Access(*.mdb) === And here, finally you can choose file name. ...

How to copy form: Access 2003 to Access 97
Hi all, I have converted a database from Access 2003 to Access 97. Everything gets neatly imported into the new database except for one form which continues to show a fatal error when I try to open it in the new 97 database: "Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience. If you were in the middle of something, the information you were working on might be lost. For more information about this error, click here ___." This is a form that I am using as a sub-form on a parent form. The parent form is imported okay but no matter how m...

OT: MS Access runtime wants to control all MS Office charts
Office 97, Access 97, Sagekeys scripts. In addtion of Access 97, my runtime package is installed too. This is an old application that has been running since 1998. The customer is happy with it. I have a glitch in.... Powerpoint 97. When an user double-clicks a chart, it starts my Ms Access Runtime Installer! It will do the same if he right-clicks and uses 'Edit'. If he selects 'Open', it will do it in a separate windows and it is Ok. Thius probably comes because MS Chart is shared among office apps. I would really like to have this problem even if there is a turnaround and I have the feeling that the solution should be in the registry, but I can't find where. Any help appreciated. TIA. "saintor1@hotmail.com" <saintor1@hotmail.com> wrote in news:1183816847.132126.79420@c77g2000hse.googlegroups.com: > Office 97, Access 97, Sagekeys scripts. In addtion of Access > 97, my runtime package is installed too. > > This is an old application that has been running since 1998. > The customer is happy with it. > > I have a glitch in.... Powerpoint 97. > > When an user double-clicks a chart, it starts my Ms Access > Runtime Installer! It will do the same if he right-clicks > and uses 'Edit'. If he selects 'Open', it will do it in a > separate windows and it is Ok. Thius probably comes because > MS Chart is shared among office apps. > > I would really like to have thi...

Accessing form control elements
Assuming you have a typical form built in this manner: <form action="..."> <p><input id="idInputText" name="nameInputText" type="text" size="20"></p> <p><input id="idCheckbox" name="nameCheckbox">optional</p> <p><input id="idRadio1" name="nameRadio">yes<input id="idRadio2" name="nameRadio">no</p> <p><select id="idSelect" name="nameSelect"><option value="a">a</option&...

How to access only boolean control value that is part of a cluster of controls
I have created a set of boolean controls in a cluster. Is there a way to access only one of the boolean control (i.e. "stop" button) so that I can change its states in the program, indepent of the rest of the boolean controls in the same cluster? &nbsp; Thanks! &nbsp; -NewUser2007 NewUser2007 wrote:-once I unbundle the boolean clusters and selected the stop boolean, how can I "wire a new value" to it (since it was created as a boolean control).&nbsp; I never said anything about "unbundle"! There is a 180� difference between "unbundle" and "bundle". :) You only need to unbundle if you want to know the current value, this is not needed if you want&nbsp;to write a new value regardless of what the current value is. &nbsp;<img src="http://forums.ni.com/attachments/ni/170/287328/1/clusterModify.png"> Message Edited by altenbach on 11-29-2007 08:20 AM clusterModify.png: http://forums.ni.com/attachments/ni/170/287328/1/clusterModify.png ...

ACCESS accessibility from a C++ process launched from an ACCESS form
Here is my problem. From an ACCESS form, I run a C++ process reaching the same database in read/write mode via the ODBC driver. An error occurs: " The database has been placed by an unknown user in a state preventing it from being opened either locked. SQLSetConnectAttr failure of the pilot " (Nota : translated approximatively from the french error message). However, if I have used an another form before (eg. to modify a table), or if I have modified myself a record of any table, there is no problem. It seems that the database is in a state " read-only " by default until th...

Convert Access 2003 database file to Access 2010
How do you convert a Access 2002-2003 database file to a Access 2010 file format? According to Microsoft (http://office.microsoft.com/en-us/access-help/ convert-a-database-to-the-accdb-file-format-HA010341552.aspx? queryid=34ea405f95aa4cb8b8ffb2764afb4993&respos=0&CTT=1) it is possible. When I tried this on the file tab it only displays the print options only. How can I get the save, save & publish, and other commands to display? My 2002-2003 Access database file has 3 tables, 19 queries, 5 forms, and 16 reports. After I open the file up it gives the "Security Warning: Soame active content has been disabled. Click for more details." then there is a button "Enable Content". Before and after I click the "Enable Button" the file tab only has print options available. Thank you for your help, jfcby jfcby <jamesfc30@gmail.com> wrote in news:f4dc9993-afa3-4fed-8180-22786eaa7f83@l14g2000yql.googlegroups.co m: > How do you convert a Access 2002-2003 database file to a Access > 2010 file format? > > According to Microsoft > (http://office.microsoft.com/en-us/access-help/ > convert-a-database-to-the-accdb-file-format-HA010341552.aspx? > queryid=34ea405f95aa4cb8b8ffb2764afb4993&respos=0&CTT=1) it is > possible. When I tried this on the file tab it only displays the > print options only. > > How can I get the save, save & publish, and other commands to > display? ...

Web resources about - Making a form control the criteria for the sql statement of another control (Access 2003) - comp.databases.ms-access

User:Jimbo Wales/Statement of principles - Wikipedia, the free encyclopedia
As we move forward with software and social changes, I think it is imperative that I state clearly and forcefully my views on openness and the ...

Category:Articles containing potentially dated statements from June 2006 - Wikipedia, the free encyclopedia ...
This is an administration category . It is used for administration of the Wikipedia project and is not part of the encyclopedia. It contains ...

Donald Trump, Megyn Kelly feud escalates: Fox News issues statement
FOX News has blasted presidential candidate Donald Trump over his “extreme, sick obsession” with female TV anchor Megyn Kelly.

Environment Canada issues special weather statement over potential spring storm for Halifax
System moving toward our region for late Sunday and Monday with heavy snow possible.

read Richard Hell's statement on Ivan Julian ahead of cancer benefit show
"It’s horrible that he has to suffer some terribly painful, life-threatening illness, and have it ravage him financially as well. American barbarism. ...

FOMC Statement: No Change to Policy, Concern about Global developments
Note: Fewer rate hikes expected. FOMC Statement: Information received since the Federal Open Market Committee met in January suggests that economic ...

NFL issues statement on how Georgia's 'Religious Freedom Bill' c - CBS46 News
The National Football League issued a statement Friday on how Georgia's "Religious Freedom Bill" could impact a potential Super Bowl in Atlanta. ...

Adam LaRoche Issues Statement On Sudden Retirement, White Sox
LaRoche is leaving the game after a "fundamental disagreement" with Kenny Williams.

LaRoche releases statement to tell his own side of White Sox story
In a statement, Adam LaRoche said a "fundamental disagreement" with White Sox president Kenny Williams led to his departure from the team.

Full text: Adam LaRoche's statement on leaving White Sox
Below is the full statement released by Adam LaRoche via Twitter .

Resources last updated: 3/21/2016 1:14:10 AM