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 Replies


ADVERTISEMENT

Queries :: Print Shipping Labels - Hide Query Results

Jul 5, 2015

I have a button on a form which is used to print shipping labels. This button runs a Query and then a report using the code below.

Private Sub SaveBtn_Click()
DoCmd.SetWarnings False
DoCmd.RunSQL "Update BookInTable SET DateBookedOut = '" & Me!DateTxt & "' WHERE BarCode ='" & Me![BarTxt] & "'"
DoCmd.RunSQL "Update BookInTable SET BookedOut = True WHERE BarCode ='" & Me![BarTxt] & "'"
DoCmd.OpenQuery "PrintLabelQuery"
DoCmd.OpenReport "Labels", acViewPreview
DoCmd.PrintOut , , , , 1
DoCmd.SetWarnings True
End Sub

But I need both the query results and the report to not be seen. All I want to happen when clicking the button is that a label is printed.

View 5 Replies View Related

Modules & VBA :: Query Results To Populate Combo Boxes

Sep 24, 2013

My company is finally using my accounts package (alongside our original package until we can be certain there are no bugs).

Anyway just adding nice to have features at the moment.

I've got a form that has 5 combo boxes where the user can select 5 customers. Then a button so they can graph the amount of money generated by each customer and compare them.

I've just made a query to return the top 5 highest grossing customers.

What I what to do now it feed the query results into the combobox values when I press a new button on my form.

How do I go about this?

View 1 Replies View Related

Modules & VBA :: Using Filter On Form To Populate Labels

Oct 28, 2014

I'm trying to add onto the open report command but having problems.I'm using the filter on a form to populate labels

Code:
DoCmd.OpenReport "Labels_Contacts", acViewPreview, , Me.Filter & "and [Mail] = 'Yes'"

and Access doesn't like this.I'm getting a 3075 error "Syntax error (missing operator) in query expression 'and [Mail] = Yes'.What is the correct syntax for this?

View 8 Replies View Related

Forms :: How To Populate Text Box With Query

May 10, 2014

I have a form with a combo box at the top that works fine. The combo box is linked to a table that has 5 parcels of land with area size, address, type. On my form i need to populate a textbox with a formula depending on what parcel of land was selected at the combo box. Such as price x area of land selected.

View 1 Replies View Related

Populate Text Boxes From A Query Result

Feb 17, 2006

hi,
I hope someone can help me here..

I have a form with ID, town and address on it.
I want to beable to type in an ID, press enter then if the ID exists in a query then populate the town and address text boxes with the correct info..

If the ID doesn't exist, then open another form so the user can choose the site from the list..

At the moment I think I am going about it the wrong way :


Private Sub ID_AfterUpdate()

intResult = DCount("*", "Q_findsite", "")

If intResult = 0 Then

Dim stDocName As String

stDocName = "Sites_listbox"
DoCmd.OpenForm stDocName, ,

End If

If intResult = 1 Then

Dim rst


--THIS PART FAILS WITH A RUNTIME 3061.. ?
Set rst = CurrentDb.openrecordset("Select town,address FROM Q_findsite ")

[Forms]![AddFault]![Town] = rst.Fields(0)

[Forms]![AddFault]![Address] = rst.Fields(1)
End If

End Sub

the Q_findsite query is expecting a parameter for ID = [forms]![addfault]![ID]


Is there an easier way of doing this ?
thanking you in advance.

View 6 Replies View Related

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 3 Replies View Related

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

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

Removing Text Labels

Jul 30, 2007

I have large sets of data that has labels on them. For example "25.56 lbs". I just want the raw numbers. Can someone help with what to type in the update to field of an update query to just keep the numbers? Thanks

View 2 Replies View Related

Seperate Text Boxes From Labels

Jun 8, 2006

I am learning access on my own using MS Press step by step manual and it tells me to hold down the shift key while selecting the text boxes that are next to the labels, but when I do the labels get selected also . how do I disconnect the labels from the text boxes in order to insert space between the labels and the text boxes as it intructs me to in the book. I am able to select the labels separately, but it will not allow the text to be selected separately.

View 1 Replies View Related

Forms :: Labels And Text Fields

May 28, 2015

I have a problem with the connection between the labels and fields in designing my form.Is there a command do eliminate the association between the two? If not I was thinking if there is a problem to delete the labels and make new ones but by doing this Access (2010) says the label is unassociated.

View 6 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

Embedded Table Showing ID's Rather Than Text Labels

Jun 2, 2006

I apologise in advance for my newbish question - I'm very green at Access. I'm trying to build a contact database for our company that lists Jobs done by customer.

I'll confess I "borrowed" the sample database provided with Access to help me out - which has worked well up until this issue.

The problem I am having is when I am working on our "Client Service History" form. (Basically the Workorders by Customer from the template - I can take a screen grab or something if it helps).

This form includes a sub-table which lists the WorkOrder ID by customer, the Date Entered, the Job Type, the Engineer and whether it was chargeable. The latter three options are choices controlled by combo boxes from the Workorders Form/Table. Where the status for "Chargeable" always comes up correctly, the Job Type and Engineer always show a number - which I presume is the ID of the label of each type - I.e. "5" refers to "Warranty Repair".

There are separate Data Tables for Engineers (EmployeeID) and Job Types (JobTypes). How do I get it to display each item correctly; as a summary of jobs done for each customer?

Any help would be particularly appreciated!!! :D

View 2 Replies View Related

Changing Text Colour Of Labels On Activate

Nov 23, 2005

Hi, im working on my school project for A2.

When the user clicks on say; the customer ID dropdown menu, i want the label text on the right of it to get darker (make it more visible). How can i do this?

(i have attached a picture of my form)

thanks, Robin

View 2 Replies View Related

Forms :: Align Text In Labels Vertically

Jun 1, 2015

Is there a way to align text in Labels vertically (top, center, bottom) ?

I see the horizontal text align property (right, left, etc) but do I miss the vertical or there is non?

View 2 Replies View Related

Forms :: Changing Color Of Text On Labels

Aug 14, 2015

I have three labels that I can't change the text color. I must have them locked or something. What should I check?

View 5 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

Forms :: How To Make Text Fields Or Labels Curved

Apr 16, 2015

Is there a way to make text fields or text labels curved?

Is this even possible?

View 1 Replies View Related

Modules & VBA :: Populate Combobox From Listbox Results

Jun 12, 2015

I have a list of staff that have a conflict of interest with a particular entity. As a result, these staff are not allowed to interview these entities.

I have a query that matches all staff with their respective entities that they have a conflict of interest with (CoI) and that is functioning correctly.

When the form loads to add an interview, there is a listbox that pulls all the people who are not allowed to do an interview with that particular entity. That is also working correctly.

I have a subform, that is a continuous form, which will allow the user to add staff, one at a time, via a drop down box. These people are stored in their own table with a FK Id to the interview table. This also works correctly.

How to filter the combobox on the subform to exclude the people in the listbox.

Here is what I have tried, loosely based on what I have found on Google and researching here. I am 100% sure it is not working correctly, but what I am missing.

The query the listbox is based on has 3 colums, the ID, the Name, and the business contract number.

Code:
Private Sub Form_Load()
Dim strSource As String
Dim i As Integer
For i = 0 To Me.lstCoI.ListCount - 1

[Code] ....

In the immediate window, I get the following result:

SELECT [staff] FROM lutStaff WHERE Staff <> name1
SELECT [staff] FROM lutStaff WHERE Staff <> name2
SELECT [staff] FROM lutStaff WHERE Staff <> name3
SELECT [staff] FROM lutStaff WHERE Staff <> name4
SELECT [staff] FROM lutStaff WHERE Staff <> name5
SELECT [staff] FROM lutStaff WHERE Staff <> name6

The issue is that the box is not filtering all the names out of the list it is built on. It is only filtering out the last name.

Obviously I need to save the results for comparison, but I am at a loss on how to do that.

View 10 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

Weird - Font On Text Labels Gets Bolder As I Move Through Records

Oct 19, 2005

Hi all,
title says it all!

I've got a form with numerous controls and labels. When i first open the form, all looks fine - all labels are Black Arial 8 Bold. But when i start scrolling through the records, the text on three of my text labels gets bolder. I haven't a clue what is causing this - the labels are just standard - two are associated with controls and one is all on its own.

I have no code written to do this, and in fact i'm not sure you could write code to do this. I've tried renaming the labels, changing the font, deleting and recreating them, but it's always the same three that get darker.

Ideas?

P.

View 1 Replies View Related

Reports :: Text Within Report Labels Different Size In Preview / Print?

Jan 12, 2015

I have always noticed that when creating a report, when you make a paragraph using a label, the alignment and size of the text/paragraph is always different when you preview the report than when you design it.

This makes alignment of paragraphs tricky, especially when you are trying to insert a bold faced word into the middle of a block of text by using a separate label.

I am using Access 2000

View 4 Replies View Related







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