Placing SQL Query Results In A Text Box

Jan 18, 2006

Hi,
I've performed a search using a SQL statement which is based upon the results of two combo boxs.

Combo66.RowSource = "SELECT Product_Id FROM Product WHERE (Name_Suffix='" & Combo60.Value & "') AND (Name_Family='" & Combo56.Value & "');"

There will only ever be one result, I can display this result in a combo box without problems but I would like to display it in a text box. Is this possible?

I'm very much a newbie to Access so any help would be greatly appreciated.

Thanks
Lee

View Replies


ADVERTISEMENT

How To Put The Query-results Into One Text Field?

Oct 5, 2005

HI!
Can Anyone help me with this?
I would like to put query results(one column) into one text field?
Is it possible that results could be in such textfield separated?
Thanks in Advance

View 5 Replies View Related

Getting Results From 7 Query's And Populate Text Labels

May 18, 2005

Ok, i have tried and searched but could not find a good start to a solution for my problem.
I have a calendar form, which shows the dates and under it text labels.
Now whenever something is present in my table (tblKalender) on those dates, i want it to show in the text labels under the correct date.
Now, i have the results through a query, but i dont want to link the query to the form. Only thing that i have trouble with now is getting the information i need to show to those labels. I have written some code (early stages) which i want to show me the results for testing, later on i can fill the fields. I keep getting an error saying not enough parameters, expected is 1.

Can anybody take a look at the code or help me with this?
My query for day one is called qerKal1 and the fields i need to get back are the hour and the task. The query gets it's criteria from the label above that day (lbDag1), which shows the date.

I have this code in a module and when the form is opened it runs the fucntion.

Option Compare Database
Option Explicit

Const strSQLWhere1 As String = "" & _
"SELECT qerKal1.Uur, qerkal1.Taak, qerKal1.Datum " & _
"FROM qerKal1 " & _
"WHERE (((qerKal1.Datum) = [Forms]![frmKalender]![lbDag1].[Caption]));"

Public Function fFillDay1()
Dim db As DAO.Database
Dim rs As DAO.Recordset

Dim strSQL As String
Dim strText As String
Dim strText2 As String

strSQL = strSQLWhere1
Set db = CurrentDb


Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly)
Do Until rs.EOF
If strText = "" Then
strText = rs!Uur
strText2 = rs!Taak
Else
strText = strText & ", " & rs!Uur
strText2 = strText & "," & rs!Taak
End If
rs.MoveNext
Loop

rs.Close
MsgBox strText & strText2
Set rs = Nothing
Set db = Nothing

End Function

View 5 Replies View Related

Display Query Results On Form Via Text Box

Aug 27, 2004

Hi,
I have created a form (Form1) based on a table (Table1) and also a Query based on this table (Query1). I calculate a field in the query (Expr1: [column1] + [column2])
Now i have created a text box on Form1 that should display Expr1.
I know I could also calculate the value directly via the expression builder, but I would prefer to simply display Expr1 from my query. Which is the syntax I have to use in the Expression Builder?
I tried "= [Query1]![Expr1]" but it does not work.
Thanks for your help
Tigrou

View 3 Replies View Related

General :: How To Get A Text Box To Display Query Results

Feb 24, 2013

I have a text box, I have pasted this into the control source:

=[qryIndividualFaultVolumes]

then on a button I have this code:

me.qryIndividualFaultVolumes.requery

However, I get a Method or data member not found error when i click the button?

View 3 Replies View Related

Queries :: Limit Query Results To Numeric Value Of Text Field?

Aug 18, 2014

I have a table that has several fields including CallID (autonumber) and SKU (text)

SKU can be anything up to 9 characters, sometimes numeric sometimes alphanumeric. For example: 24300, AA23145, G58d444, 24999, 89332,...

Based on the Count of CallID I can easily get the top20 calls on each SKU. This is the query I use for that:

Code:
SELECT TOP 20 Count(Calls.CallID) AS CountOfCallID, Calls.SKU
FROM Calls
GROUP BY Calls.SKU
HAVING ((Not (Calls.SKU) Is Null))
ORDER BY Count(Calls.CallID) DESC;

The problem is that now I have been asked to create two different lists. One that has the top 20 SKU that range from 24520 and 24599 and another one that does the res tof the SKUs.

Obviously my problem is that the SKU field is text, not numbers so I can't just limit the results in the query by using "Between 24520 and 24500" in the query criteria.

View 7 Replies View Related

Reports :: Output / Print Results Of A Query To Text File

Dec 13, 2013

I have researched on here how to print the results of a query to a text file. I put the code in and I get an error on the openrecordset line. The error says "too few parameters, expected 4"

I tried the query in another report I export to excel and the query works.

I tried printing the whole table using "Select * from tbl_Customers" and it works????

Here is the code:

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("qryBell1", dbOpenSnapshot)
Dim fs, TextFile
Set fs = CreateObject("Scripting.FileSystemObject")
Set TextFile = fs.CreateTextFile(pathname, True)

[Code] ....

the query returns 6 fields for printing and can filter based on whether 3 fields are filled or not on the form - Date, Campaign, Status

View 6 Replies View Related

Modules & VBA :: How To Make A Text Box To Show Results Of A Query To Display On Screen

Dec 4, 2014

We have a button running a SQL query via VBA, how can I make it so the results doesn't show up in a table/preview?Also, I know it's for the SQL forum but how can I make a text box to show the results of a query to display it on screen?

View 8 Replies View Related

Queries :: Inventory Database - Displaying Results Of Query In Form Text Boxes

Aug 7, 2015

I have a Inventory DB and i want to integrate scanning. So far i have a table called StockInfo, this table holds information about bar codes (device type, make, model). I have a form called Scan_Barcode, on this form I want to be able to scan a bar code into a text box (text0) and use a afterupdate and requery function to display the results onto a form called EnterInventory.

Not only just the results but I want certain columns from the query to display in certain text boxes on this form. I have a query called FindProduct. that filters the criteria by whats entered on the Scan_Barcode text box (text0). So when i scan a certain bar code i can get the query to display certain product information for the bar code. I just cant get the results onto the HarwareStock form.

View 8 Replies View Related

Forms :: Open A Form For Saving Results Of Query To A Text File On Desktop

May 6, 2015

I have a BE database, that when opened, opens a form for saving the results of a query to a text file on the desktop. It works fine, if the full path is entered.

The problem is, I want this saved on any users' desktop. I did some digging and found the %userprofile% variable, which when used, gives me the error.

I understand this should work in both Windows XP and Windows 7, which are the environments the full DB will operate in. So far the "EXPORT" button on the form has the following for the code:

Code:
Private Sub BTN_Export_Click()
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", "C:UsersMark N. McAllisterDesktopPubComExp.txt"
End Sub

When I tried this:

Code:
Private Sub BTN_Export_Click()
Dim strPath As String
strPath ="%userprofile%desktopPubComExp.txt"
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", strPath
End Sub

the error occurs.

View 10 Replies View Related

Placing A Graphic On A Label

Dec 1, 2005

I have rcently produced a label report for my Xmas cards, and I would like to add a picture to the label in the form of Father Christmas. Can anyone help me on this subject.

View 1 Replies View Related

Placing Fields On A Form

Sep 21, 2006

I need to place fields on a form that is not linked to a table or query. Form was built by my predecessor and it already contains multiple fields, however the form itself is not linked to any data source. I have tried hardcoding the field onto the form, but it didn' take. How is this done?

View 1 Replies View Related

Placing Fields On A Form

Sep 21, 2006

Need help placing fields on a form that is not linked to a table or query. The form was created by my predecessor. The form already has multiple fields on it, however the form itself is not linked to any data source. I have tried hardcoding the filed onto the form but it didn't take. How can this be done?

View 1 Replies View Related

Placing An Access Database On The Web/server

Jul 17, 2006

I have a database with a couple of search forms to use for my company. My boss wants me to place this on the intranet so anyone can use it not only those with MS Access, which many people do not have on their computers. Please let me know if there is a way to do this and still make it interactive by means of searching. Thanks


Riley

View 1 Replies View Related

Placing A Formula In A Form Field

Apr 11, 2005

Hi all,

A nice easy one for you. I am creating a database, one of the fields is total cost. Is there an easy way to have another field, which calculates the VAT without using a query? I would like this done as soon as the total is entered.

I have done this using a query, but didnt like this way.

I am sure there must be a very simple way of doing this but it has escaped me.



Help


Phil

View 2 Replies View Related

Queries :: Retrieving Multiple Rows And Placing In One String

Jan 31, 2014

I am trying to write a query that selects multiple rows of a table and puts those into a single string with a comma delimiter.

I want it to select all rows after a specific word is found in the row above and then stop selecting when another specific word below the last row is found.

Example below: >>>

The data i am using is very unorganised and has not headers, so I have to try and specific lines in order to allocate them to a specific user.

Sample Data:

IDFullContent
459Authorized Privileges:
460ACNT ALLSPOOL ALTPRI AUDIT BUGCHK BYPASS
461CMEXEC CMKRNL DIAGNOSE DOWNGRADE EXQUOTA GROUP
462GRPNAM GRPPRV IMPERSONATE IMPORT LOG_IO MOUNT
463NETMBX OPER PFNMAP PHY_IO PRMCEB PRMGBL
464PRMMBX PSWAPM READALL SECURITY SETPRV SHARE
465SHMEM SYSGBL SYSLCK SYSNAM SYSPRV TMPMBX
466UPGRADE VOLPRO WORLD
467Default Privileges:

Output Expected:
"
ACNT,ALLSPOOL,ALTPRI,AUDIT,BUGCHK,BYPASS,CMEXEC,CM KRNL,DIAGNOSE,DOWNGRADE,EXQUOTA,GROUP,GRPNAM,GRPPR V,IMPERSONATE,IMPORT,LOG_IO,MOUNT,NETMBX,OPER...etcc "

The delimiter can be anything.

View 1 Replies View Related

Forms :: Taking Data From Form And Placing Into Table

Nov 20, 2013

I have a form that I am inputting data into. I have been able to Clear the form. I have created an edit script and it brings the data from the table to populate the form. When I try to change the data in the form and run a VBA update to push the data down to the table I am having no luck. I can add/Delete recordswith no problems but I can't edit them and put them back in the table. I am novice and just learning the formats and scripting.

View 7 Replies View Related

Forms :: Error 1907 When Placing Chart Control Within A Form

Nov 3, 2014

I have just tried experimenting with placing a Chart control within a form (Access 2010). Although the chart ultimately seems to work (based on my one simple example), I'm getting an Error 1907 (Could not register font.......) each time I launch the database or reload or edit the form.

This error message is itself contained within a "Configuration Progress" screen for MS Office Prof + 2010 which seems to complete if I select Ignore the error message but runs again each time the database is launched (with the same error message showing up part way through). I am logged on as Administrator.

View 2 Replies View Related

Placing User-Defined Search Parameters In Report Header

Apr 11, 2014

I created a Access 2010 database query to allow a user to search a list of orders between 2 dates, and I created a form for them to use for this search.

Then I created a report for the search results to land on. What I want to do is have the 2 dates that the user provided be displayed in the header of the report.

I created a new Text Box and placed it in the header. In place of the "Unbound" filler that was there, I placed

"=[Forms]![frm_DateRange]![txtStart]".

I used the following steps to do this:

Clicked on the Text Box controlPressed the "Property Sheet" buttonSelected the "Data" TabPressed the "..." button next to the "Control Source EntryThe "Expression Builder" came upDouble-clicked on the database name in the "Expression Elements" windowDouble-clicked on "Forms", then double-clicked on "All Forms"Selected the rpt_DateRange" formSelected "txtStart" from the "Expression Categories" window.I did not select anything in the "Expression Values" window.

When I go to "Report View", and see the Text Box I added, but inside it, it just says "#Name?"

View 7 Replies View Related

Display Qry Results In Text Box

Apr 17, 2006

Hello Experts,
i have this small problem with my qry results not being displayed in the text box.

tbl Issues= status field and many other fields
tbl Status= Active or Closed

here is my qry
SELECT Count(Issues.Status) AS CountOfStatus
FROM Issues
GROUP BY Issues.Status
HAVING (((Issues.Status)="Active"));

I have tried typing this code on the control source of the text box
=DCount("PartNumber","Issues","Status=Active")
but it doesnt work.

All i want to do is display my results in a text box on a form.

Any help
Thanks alot

View 2 Replies View Related

Save Numeric Results As Text

Oct 20, 2006

I have a query that calculates the number of games won and lost over the course of a season.
I would like to export the query results as a report in Excel format.

What I need to do is take the won/loss field in the query
WonLost:([GamesWon]&"-"&[GamesLost])
and export the result as text.

When I do it as above, the results in Excel are numeric.

Example: Games Won = 12 Games Lost = 3 it exports it as 9
(12 subtract 3).

View 7 Replies View Related

Queries :: Merging Results To Single Text Box

Oct 28, 2013

I have a large database which runs various reports however i am struggling with the last bit to get this report working.

Under each "Works Order" is a set of scrap which is associated with this batch. Instead of rows of data i would like to add all the "reason for scrap" to a single text box for each works order:

i.e. WO: 259953 | Scrap: Sub contract inner open; Untraceable short; short to plane etc etc.

I have attached an image in its current format.

View 1 Replies View Related

Union Queries - Results Showing As Text & Not Numbers

Dec 13, 2007

To cut a long story short, i've got a union query that is a full outer join of 2 tables.

Anyway, the results i have got back needed formatting to no decimal places.

How do i do that?

I've tried leaving it as it is and formatting it in the report, but it still doesn't format and i can't total it up.

It's like it is showing as a text and not number.

Is there a way of converting the result to a number, particularly in a sql query.

View 2 Replies View Related

Converting Option Box Number Results Back To Text

Jul 20, 2005

I have an option box 1=Yes, 2=Np 3=Unknown. the result is stored in a field in my table. When i run a query I pull up the numbers 1, 2 or 3 but to put in a report I actually want the written answers. How do i convert them back?

View 9 Replies View Related

Query Results Minus Query Results = New Query?

Apr 1, 2008

I used to queries ,1 to get items that are taken ( its all about sign in sign out for equipment) and other query is list of all items.
How can i make 3rd query which will give me all but taken items from query1?
(of course items from query 1 are in query2)
thx in advance

View 7 Replies View Related

General :: Randomly Pick Record From Table And Display Results In Two Text Boxes?

Sep 1, 2013

I have one table (500 Club) with two fields (ID) (Name) i would like to randomly pick a record from the table and display the results in two seperate text boxes on a form one for (ID) and one for (Name). I intend to use this for a monthly draw at my workplace.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved