Simple Access Query

Hi

I would like to allow the user to click on a button and then call a query 
and assign the returned value to a textBox control

How can I do that?

Thank you,
Samuel 


0
Samuel
6/10/2007 4:16:39 PM
access 16762 articles. 3 followers. Follow

4 Replies
623 Views

Similar Articles

[PageSpeed] 51

Realistically, you don't need to call a query. Using the DLookup function 
should be sufficient to return the required value from the query.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Samuel" <samuel.shulman@ntlworld.com> wrote in message 
news:ObHv4q3qHHA.1212@TK2MSFTNGP05.phx.gbl...
> Hi
>
> I would like to allow the user to click on a button and then call a query 
> and assign the returned value to a textBox control
>
> How can I do that?
>
> Thank you,
> Samuel
> 


0
Douglas
6/10/2007 4:41:59 PM
Any samples please?


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message 
news:u3jzD53qHHA.4624@TK2MSFTNGP06.phx.gbl...
> Realistically, you don't need to call a query. Using the DLookup function 
> should be sufficient to return the required value from the query.
>
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Samuel" <samuel.shulman@ntlworld.com> wrote in message 
> news:ObHv4q3qHHA.1212@TK2MSFTNGP05.phx.gbl...
>> Hi
>>
>> I would like to allow the user to click on a button and then call a query 
>> and assign the returned value to a textBox control
>>
>> How can I do that?
>>
>> Thank you,
>> Samuel
>>
>
> 


0
Samuel
6/10/2007 5:40:47 PM
DLookup("NameOfField", "NameOfQuery")

That assumes that the query only returns a single row. If it returns 
multiple rows, you'll need to provide the 3rd argument, which is a Where 
condition without the word "WHERE" in it:

DLookup("NameOfField", "NameOfQuery", "Field1 = 1 And Field2 = 'Help'")

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Samuel" <samuel.shulman@ntlworld.com> wrote in message 
news:uD4u5Z4qHHA.4520@TK2MSFTNGP04.phx.gbl...
> Any samples please?
>
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message 
> news:u3jzD53qHHA.4624@TK2MSFTNGP06.phx.gbl...
>> Realistically, you don't need to call a query. Using the DLookup function 
>> should be sufficient to return the required value from the query.
>>
>> -- 
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "Samuel" <samuel.shulman@ntlworld.com> wrote in message 
>> news:ObHv4q3qHHA.1212@TK2MSFTNGP05.phx.gbl...
>>> Hi
>>>
>>> I would like to allow the user to click on a button and then call a 
>>> query and assign the returned value to a textBox control
>>>
>>> How can I do that?
>>>
>>> Thank you,
>>> Samuel
>>>
>>
>>
>
> 


0
Douglas
6/10/2007 5:55:10 PM
Thank you

Samuel

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message 
news:%2319m9h4qHHA.500@TK2MSFTNGP02.phx.gbl...
> DLookup("NameOfField", "NameOfQuery")
>
> That assumes that the query only returns a single row. If it returns 
> multiple rows, you'll need to provide the 3rd argument, which is a Where 
> condition without the word "WHERE" in it:
>
> DLookup("NameOfField", "NameOfQuery", "Field1 = 1 And Field2 = 'Help'")
>
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Samuel" <samuel.shulman@ntlworld.com> wrote in message 
> news:uD4u5Z4qHHA.4520@TK2MSFTNGP04.phx.gbl...
>> Any samples please?
>>
>>
>> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message 
>> news:u3jzD53qHHA.4624@TK2MSFTNGP06.phx.gbl...
>>> Realistically, you don't need to call a query. Using the DLookup 
>>> function should be sufficient to return the required value from the 
>>> query.
>>>
>>> -- 
>>> Doug Steele, Microsoft Access MVP
>>> http://I.Am/DougSteele
>>> (no private e-mails, please)
>>>
>>>
>>> "Samuel" <samuel.shulman@ntlworld.com> wrote in message 
>>> news:ObHv4q3qHHA.1212@TK2MSFTNGP05.phx.gbl...
>>>> Hi
>>>>
>>>> I would like to allow the user to click on a button and then call a 
>>>> query and assign the returned value to a textBox control
>>>>
>>>> How can I do that?
>>>>
>>>> Thank you,
>>>> Samuel
>>>>
>>>
>>>
>>
>>
>
> 


0
Samuel
6/11/2007 1:10:00 PM
Reply:

Similar Artilces:

Access 2007 Special Effect Text Box Won't show Sunken with Windows XP
Hi All I am just getting to grips with Access 2007 and one of the quirks I have found is that when I design using Windows in XP Windows-Classic colors and set the text boxes on forms' special effect property to "sunken" They appear as sunken in the correct manner. However, when I change to the Windows XP color scheme the forms text boxes appear flat even though the special effect property has not changed. Any ideas or is it a new quirk we have to live with. I haven't tried it with Vista yet. That should be interesting Thanks Bob I am quite sure this is the same for acce...

Ms access data type detail
I am using Ms access 2007, can anyone explain to me all the DATA TYPES, like what are their limitations etc. Also how can i create a drop down list and allows selecting more than 1 texts. e.g ... in my db i have an option for known languages and the answers could be more than one. English, French, Spanish etc Start here http://office.microsoft.com/en-us/training/HA102744471033.aspx Aamir wrote: > I am using Ms access 2007, can anyone explain to me all the DATA TYPES, > like what are their limitations etc. > > Also how can i create a drop down list and al...

Count records in a query
Hello! I have a query that runs pretty slow, and I'd like to alert the user before running the query. So I have a source query for my slow query, and I'd like to count the records in my source query and estimate the time the query will take to run. How can I do this in VBA? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/201005/1 DCount("*","Your Source Query Name") This will give you the number of records in the Query "AtleDreier via AccessMonster.com" wrote: > Hello! >...

Crosstab Query For Fiscal Year Totals
I want to write a crosstab query for FY totals that will show each month regardless of wether there is data or not. Any help on this is greatly appreciated. Thanks! The trick is column headings. Open the query in Design View. Right click up where the tables go and select Properties. In there is column headings. Put in the expected column names in order. Something like: "Jan","Feb","Mar" and so on. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "DevlinM" wrote: > I...

Query error after converting
I'm running Access 2003. I have a working database. It seems as if the database is in Access 2000 format, because when I go to Convert, the 'Convert to Access 2000' option is grayed out. I need to convert this database to both Access 2002-2003 and Access 97. I have this part of VB code, and it works fine in the current version, as well as in Access 2002-2003 (after converting to Access 2002-2003). Dim rstRoutes As Recordset Dim strSQL As String ...... strSQL = "SELECT DISTINCT [Route] " & _ "FROM Highways_Info " & _ "WHERE ...

RelationShips Queries and joins
Not sure where to start and the posts I have read I do not fully understand I created 2 tables (remitt and Billing) and for each table I created a query--Because I needed to create a commmon expression (1st 10 digits of a name & a w/e date & Pay code). The names never match 100% I want to make a final query and bring over the Billing info into the remitt and create a final query Can I do this? Post the SQL of the two queries you have now by opening in design view, click on VIEW - SQL View, highlight all in the window that opens, copy, and paste in a post. -...

Access to News groups disappears after first use and exiting.
Have used OE for a number of years for email and News Group access. Thought I might experiment and then switch to Outlook. Set it up, and, received reply on the test. I know it was working. Then tried to set up newsgroups. Followed directions as outlined in help. Last direction was to drag News to "Go". Finished ... went to go and selected News. All the News Groups I had earlier setup in OE came up. Played around looking at some posts. Then exited. Then when I went back to Go, News was no longer there. Completely disappeared. I am using Outlook 2003. Actually recopied a "Gh...

Query Help : accounts which are not members of existing marketing list
Hey all, I have few marketing lists and having lot of accounts as members . Now i am interested to make a new marketing list with new members , which are not member of any of existing marketing list. Is there any way to see which accounts are not member of existing marketing list ? Thanks Aami Sure AAmi, Not within CRM but you can run this in the SQL Query Analyzer to find them: select * from accountbase A left join ListMemberBase L on A.accountid = L.entityID where L.entityID is null HTH, Dave Aami wrote: > Hey all, > > I have few marketing lists and having lot of accounts...

connecting to data access page with filter criteria
I have an access database that I connect to from a GIS application (ArcView) using VBscript. I need to port my GIS project to the free viewer (ArcReader) which does not support VBscript but does support hyperlinking to a URL based on a value supplied by an underlying record. In my current project I can send filter critera to open a particular database, form and record. Would it be possible to do the same using data access pages or would I need to create a separate page for each record I want linked? ...

Extract Data from curupted Access 2000 Database
any sugestion on how to Extract Data from curupted Access 2000 Database ??? the Error i get when attempting to Open The microsoft jet database engine stoped the process becouse you and another user are attempting to change the same data. Hi Levon, See http://www.granite.ab.ca/access/corruptmdbs.htm On Tue, 1 Jun 2004 10:34:58 -0700, "Levon" <anonymous@discussions.microsoft.com> wrote: >any sugestion on how to Extract Data from curupted Access >2000 Database ??? > > >the Error i get when attempting to Open > >The microsoft jet database engine s...

Summary Query
I need help with a quey. First I have a table that has different columns, two fields that I want to use are "CSR" and "Responses". these two fields are lookup and linked with two tables. Now i need a report based on query, where I can have CSR names on left, and on top responses, showing the counts. I know I can do it through Pivot Table but then i can not export it to Excel as simply text. -- Message posted via http://www.accessmonster.com How about a Crosstab Query with CSR as a Row Header, Responses as a Column Header and Count of Responses as the Value? This wi...

Access application on clients without Access
Hi. I have an application made in Access 2003. Now one of my clients are migrating from Office 2003 to Office 2007, and they can not afford to buy Office versions with Access included to all the users. I know it's possible to publish "thin" Access application files, but I'm not sure how I do it. From Access 2003, I need to publish "thin" Access application files that will work on clients running Office 2007. Ant hints or links to resources appreciated. Kind regards Mr. Smith Try this one from Microsoft: http://www.microsoft.com/downloads/details.aspx...

How do I install Access 2003 under MS Office 2007
I am trying to install Access 2003, but because I have Office 2007 installed, the system is telling me that I need to have Office 97, 2000 or 2003. Is this correct? I loaded my old Access 97 CD, but the system tells me that it can't find Office 97, 2000 or 2003. Is there an upgrade for Access 2003? What do I do? Thanks... It is generally recommended to install versions of Office/Access in the order they were published. I have done otherwise though. It is imperative that you install each version in it's own directory, otherwise they will overwrite one another and crea...

link append query to combobox
I have a form (tester) that contains two unbound comboboxes. The first, cboMRSearchChart looks up a specific ID number (text datatype) for a patient, and the second (cboDOVSearchChart), displays the dates of visit associated with that ID number. The two fields are from the table "Patient Visits," where an autonumber Chart ID serves as the primary key. The selection of a date updates a subform (sbfPatientVisits), which is related to the mainform via Chart ID number. The column with Chart ID is present in the Date of Visit combobox, but is hidden from view. In the NotInList event of t...

completing a query
Hello everybody. I have this query which works fine. It takes its parameters (date from - date to - reasons) from a form. This works also fine. I sometimes need to be able to see all the reasons "causali" between specific dates. I would like to know if and how that is possible by just leaving the "causali" combobox empty. Of course any other suggestion is more than welcome Thanks -- Lisa Save the Dogs Onlus - www.savethedogs.eu Aiutaci a costruire il nuovo rifugio, dona il 5 per mille a Save The Dogs : 97394230151 Lisa If your query needs to display the &quo...

How do I regain access to Clipart in Publisher 2003?
Has anyone else had problems with Publisher 2003 losing access to clipart that was previously available within the programme. I seem to have lost access over the past couple of weeks. How do I overcome this problem? Graham Cross wrote: > Has anyone else had problems with Publisher 2003 losing access to > clipart that was previously available within the programme. I seem > to have lost access over the past couple of weeks. How do I overcome > this problem? Publisher 2003 has no (or minimal) clip art available "within the program". 99.99% of clipart available to 20...

Access a Share with an "impersonation" account
I have done some research on this but so far all I have found is how to setup an impersonation account on an IIs server and access it via an ASP.NET app. We have a need to set up a network share, restrict all regular users from even seeing any files that may be in there withthe Windows browser, but have an app that any of these users may run that can see and access files in that file share. I know there has to be a way to do this. I would appreciate any advice. Joe Cool wrote: > I have done some research on this but so far all I have found is how > to setup an impersonati...

Using Query by typing " SELECT......"
Hello, When I saw on the addresss sample database, the form Household is uing query by just mentioning SELECT...... My question is how can type SELECT then prompt the table to us. I normally use grid query, what is the difference using grid query of SQL Query ( is it SQL that using SELECT....?) Many thanks for any idea provided -- H. Frank Situmorang The RecordSource property of a form can accept: - a table name - a query name - a SQL statement. You can change the RecordSource property of the form programmatically. For example, if the form currently has a RecordSource of: SELECT ...

Simple Reflection example give Exception
Hi! This program is supposed to create these rows dynamically Hashtable tbl new Hashtable(); tbl.Add("Hi","Hello"); int foo = tbl.Count; Here I have a simple example that give exception when this row is being executed *ConstructorInfo ctor = hashType.GetConstructor(argumentTypes);* the exception I get is the following when I translated from my native language "NullReferenceException was unhandled the Objectreference has not been given to an instance of an object" Is it anyone that might have an idea what I have to change ? static void Main(...

Can Access Runtime 2007 operates MS Access 2003 application?
Hi everyone, Has anyone tried to use Access Runtime 2007 to run the database application written in MS Access 2003 format? Thanks in advance Keith On Tue, 22 Jan 2008 09:31:20 +0800, "Rabbit" <a@a.com> wrote: Ha, you're thinking "free runtime", why pay for the A2003 runtime? Let us know how you fare. -Tom. >Hi everyone, > >Has anyone tried to use Access Runtime 2007 to run the database application >written in MS Access 2003 format? > >Thanks in advance >Keith ...

Access 2003 front end with sql 2005 backend
Hello, I have converted my split MDB configuration to an Access 2003 front-end with a SQL 2005 backend using ODBC. I am experiencing a situation with the new configuration where I am unable to copy & paste records that was done rather easily with the split config. Otherwise all functionality entering orders and order details works fine. Specifically, I have an ORDERS table that has linked data to an ORDERDETAILS table. Each order has an ODERID primary key with identity. The UI for this exists in a form that has ORDERS table as the parent and a subquery form(ORDERID id t...

Problem with query dates
Hi My records date range in the database is Betwene 20/05/20010 and 22/05/20010 . When my dateObject has a date of 24/05/2010 00:00:00, is shown me all the records less than this date, OK. But if I change the month, this date to 24/04/2010 00:00:00 shows the same records. That is even if I change the month the records that appear are always less than the 24 days without following month. There lies my problem. Note: My date style is dd-mm-yyyy and time is hh: mm: ss I really need to fix this.Seabra Dim Q1, SQL As String Dim DateTime1 As Date Dim ConnString As S...

Access 2007 and Access demand
Access is a wonderful DB. Looking for general discussion here. Those who participate here appear to LOVE Access..I do. Dice.com has new discussion boards. J2EE and .Net have "demand", but others there say not so. So..for many of us, Access is our Profession. It appears a recession is soon. The best way to find work now is??? I've been Programming Access for years for 2 major companies, the work still is there, but the hours are decreasing. Would looking to program Access at smaller companies be wise...I saw that 78% of USA companies have 25 or less employees. TIA - B...

Simple question
Can Outlook 2003 co-exist with Office 2000? Yes, assuming OL2k is not installed "Andy Williams" <f_u_b_a_r_1_1_1_9@y_a_h_o_o_._c_o_m> wrote in message news:esY2Ei%23pEHA.1712@tk2msftngp13.phx.gbl... > Can Outlook 2003 co-exist with Office 2000? > > Co-exist, yes. Interoperate - no. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After a lot of head-scratching, Andy Williams asked: | Can Out...

Simple encryption / decryption
Hello fellow Newsgroupies, I'm looking for a simple encrypt / decrypt API function or algorithm which I can use to disguise some data (don't need it to be super-duper- secret-squirrel) with a simple 'key' preferably one which is reversible, so Xor-ing based might do it. Something like, BOOL CryptFunc(BYTE * pKey, const int iKey, BYTE * pData, const int iData); where a key of bytes of a certain length can be used to encrypt and decrypt some data of a certain length with the same key. I really don't need any of the CCryptKey service provider type stuff. Many thanks in a...