Generate Value For Text Field In Report Based On Query

Jan 20, 2008

Okay I have a report (rptHorneOstbergQuestionnaire) that is based on a query (qryrptHorneOstbergQuestionnaire). In the report I have a total (HOTotal) which is the result of an expression created in the qry. Based on this result I would like to generate text in a text field (HOType) that is found in the same report.

Basically if the field HOTOtal shows any vaue between:
16 and 30 then I want the unbound text field to show the text Definitely evening typw and so on ...(see case statement below)

I thought I could do a case statement on report open but I am getting an error that my expression contains no value.

Here is the case statement

Private Sub Report_Open(Cancel As Integer)

Select Case Me.HOTotal

Case 16 To 30
Me.HOType.Value = "Definitely evening type"
Case 31 To 41
Me.HOType.Value = "Moderately evening type"
Case 42 To 58
Me.HOType.Value = "Neither type"
Case 59 To 69
Me.HOType.Value = "Moderately morning type"
Case Else
Me.HOType.Value = "Definitely morning type"

End Select

End Sub


What else can I do?

View Replies


ADVERTISEMENT

Text Box Button Query To Generate A Report

Jan 23, 2007

Hello all

i need to create a text field and button in a form that will show all the records for a particular JobNo in a report once the txt has been typed and the button is clicked, i.e if I type JobNo001 I need to to create a report showing all the information for that JobNo(but there can be multiple JobNo's).

Do i have to create a query for this. I am new to this so please be gentle

Thanks

Chris

View 1 Replies View Related

Generate A Report Based On Value From Combo Box

Aug 29, 2011

I am trying to design a form which would have a combo box cbo1(Market) and a command button (btn1) to finally view a report based on the values selected in the combo box. The query (say qry1) that the report uses has about 11 columns, in which Market is one of them. And I have 8 different Markets. Now i need to be able to generate the report for two options:

1. I should be able to show the columns for the selected market ONLY(it need not be multiple selections; just one will do). Example: If I selected the Market 'Chicago', I want the report to display the column values for only Chicago.

And the other option is.

2. I should be able to show the columns for 'ALL' markets together. I dont actually have an option by name 'ALL' in the 8 values for market. I would like the combo box to show the option 'ALL' along with the 8 values in the list.

View 9 Replies View Related

How To Generate Report Based On Combo Box Selection

Jun 30, 2005

Hi guys . I created a form that has 3 combo boxes. Their name are Project Number, year and weekno . It has also a button that on click action supposed to generate a report baced on my combo box criteria and then loads that report for me. could any expert show me an example on how to do this. I have difficulty finding an example in google since i did not exactly what is called this method of generating report in access 2000.Thanks

View 2 Replies View Related

Forms :: Formatting Text In Report Based On Yes / No Field

Jul 25, 2014

I am having problem on formatting text on a report based on a Yes/No field using Conditional Rules Manager in Access 2010. When adding a rule [field name] = Yes the font color does not change. I have tried setting the expression to [field name] = True and still does not change the color. Adding a Yes or True in query works OK.

View 12 Replies View Related

Tables :: Auto Generate Hyperlink In Table Based On Field Name

Aug 29, 2014

I Have a table with 15000 entries. This table lists components we use. This table is used to generate queries/forms. I have been asked to add a hyperlink to this table to link to a drawing of the component. All the drawings are in PDF and in the same folder. I am looking for a way to automatically update the hyperlink fields all at once. The Hyperlink will be in the format of servershareddrawings12345.pdfwhere 12345 is the component name from the table.

But there are a few small problems with the component names.
1. If the component begins with a B- . The drawing name will be all the characters except when there is a second dash in the component. So if the component is B-12345-678 the drawing name will only be B-12345.
2. If The component begins with AB, The drawing will be the first 5 characters regardless of what follows, e.g. AB123.
3. Finally for all other components the full component name will be the drawing name.

Putting the naming to one side, how to go about auto generating the hyperlink. I have posted this in the table section, but maybe this should be in another section like queries or VBA.

View 2 Replies View Related

General :: Auto Generate ID Where Field Is Text Format

Jul 10, 2012

I have
Table called "Products"
Field 1= "Product ID" which is a text field (PK) but numbers are used (ie 1 -20)
Field 2= Products -showing our list of 20 products

When I enter a new product, currently I have to look in the table to find the last ID used then use the next one available. I have created a form to be used for data entry to enter new products

What I am trying to do is :- 1, have the form open at data entry level but still able to scroll and see all records and 2, Have the form auto generate the next number available. For example, I have 20 products entered so when the form opens to enter a new product, the ID is automatically at number 21. I know absol nothing about coding. I have looked at other suggestions on the forum incl the DMAX +1 and having tried and not worked, I wondered if its because the field is a text field or I am trying to insert the code in the wrong place.

View 4 Replies View Related

Generate Random Password To Text Field From A Button

Jun 10, 2014

How can I generate a random string to a text field from a button. I

Say I have a form..

On the form I have:

X1 Button (BTN-Generate-Password)
X1 Text Field (TF-Generated-Password)

How can I make it so when the button is clicked a random string will appear in the text box

HTML Code:
Private Sub BTN-Generate-Password_Click()

(What Do I put here?) (Will it populate the Text Field?)

End Sub
- 9 Characters
- Upper and Lower Case
- Numeric & Alpha Numeric
- These Characters (!@#$%)

View 1 Replies View Related

General :: Auto Generate A Number In Where Data Field Is Text

Jul 10, 2012

I have

Table called "Products"
Field 1= "Product ID" which is a text field (PK) but numbers are used (ie 1 -20)
Field 2= Products -showing our list of 20 products

When I enter a new product, currently I have to look in the table to find the last ID used then use the next one available. I have created a form to be used for data entry to enter new products

What I am trying to do is :- 1, have the form open at data entry level but still able to scroll and see all records and 2, Have the form auto generate the next number available. For example, I have 20 products entered so when the form opens to enter a new product, the ID is automatically at number 21.

I wondered if its because the field is a text field or I am trying to insert the code in the wrong place.

View 1 Replies View Related

Autofill Text Field Using Combo Box Selection To Generate Autonumber

Dec 10, 2013

Autofill text field using combo box selectionHello,

I'm trying to autofill a field on a form using MS-Access 2010 Web version sharepoint using macros without coding.

The form has an existing Combo Box field called Segment, using the row sources "REW", "WTT", "DBM".

A user begins filling out the form and eventually selects the Combo Box for Segment and selects any one of the segment no Multiple selection

There is another text field, which is actually alpha-numeric, called Job_No. I want this to autofill based on their Segment selection, using this format:

REW-YYMMDD-TTTT, or REW-131210-20001 for example, for today with the time displayed as military time and last Job No.(20001) for REW and Also for WTT (30001) as starting number.

View 1 Replies View Related

Forms :: Generate Custom Form Based On Query Results

Dec 11, 2013

I'm trying to track daily production at a manufacturing company running many different processes at different locations each running multiple parallel "lines." The tricky part is that the number of lines running and the shift schedules e.g. 2shifts 10hrs/day 4days/week or 3shifts 8hrs/day 5days/week change frequently for each process.

Right now I have a form for process data that specifies the schedule and number of lines running each day. Then I'm running an append query to a "production" table that generates blank production records associated with each item made in each process for the correct shift/line combinations.

Up to now I've been manually changing the date on the append query each time I run it. Then I have a seperate query for each process that pulls out the production records for each day. My problem is that the preferred interface for production data entry is a spreadsheet with the following layout:

--------DAYS LINE 1 DAYS LINE 2 SWING LINE 1 SWING LINE 2
ITEM 1 100
ITEM 2 2250
ITEM 3

which changes each time the shift/line schedule changes for each process. The only way to achieve this layout I know of is a crosstab query which isn't updateable. Ideally, each day the manager will specify the shift schedules and forms will be automatically generated with the correct structure and sent to the process supervisors. I'm open to different form layouts and even redesigning the database completely.

View 2 Replies View Related

Modules & VBA :: How To Make Particular Text Field BOLD Based On Value From Query

Jul 20, 2015

I am using MS Access 2007 and have a report which display the list of values (say 10 fields) from the basic SELECT * FROM table query.

I need to dynamically set the BOLD based on the particular value for the fifth field which was assigned from Query. if it doesn't match it should display normal.

E.g
If Field_5 = "Agent" then
Field_5.FontBold = True
Else
Field_5.FontBold = False
End if

I tried the aforementioned code and it dont work. ALso i tried achieve it using below listed options.

Me.Field_5.FontBold = True
Field_5.Properties("fontweight") = 700

But nothing worked.

View 5 Replies View Related

Reports :: Using Form Or Query To Generate Report

Apr 10, 2013

Using a table with employees, I created another with equipment that uses a lookup to assign each piece of equipment to an employee (more than 1 piece of equipment can be assigned to each employee)

I want to be able to select records using a form, either by checkbox or listbox of which employees to include in the report that shows what equipment each is assigned. The problem I am having is creating the form/code to create the and/or query to generate the report.

View 2 Replies View Related

Forms :: Update Query And Generate Report

Dec 26, 2014

I am building a form that updates a query and then generates a report based on the updated query. I am having two problems;

1. I have successfully concatenated the "First Name" and "Last Name" fields in the query to appear as First space Last, but in the actual report I get a compile error. I've tried everything I can think of with no luck. This is what it looks like in VBA:

"SELECT [VoCSurveys].[First Name] & " " & [VoCSurveys].[Last Name] AS Name, ... " & _

2. I am trying to figure out how to update two labels (lblDescription and lblSecondaryDescription) on my report with the information the user types in the text boxes (txtDescription and txtSecondaryDescription) on the form. I tried calling a variable for each label and setting it equal to the corresponding text box, but I didn't think it would work and I was right.

View 3 Replies View Related

Modules & VBA :: Generate And Send By Email Individual Reports Based On A Query

Mar 19, 2014

I am trying to make an automation in order generate reports based on query ( person name,person email address ) , export them to a folder in PDF and then send them one by one to each person email address.

What is happening:

- the reports are generated and exported fine
- the email are sent to the right addresses but the first person receives the correct report , the second person receives the report from the first person plus its own report and so on.

Here is my code :

Private Sub MakeReportSendEmail_Click()
Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Dim strSQL As String
Dim strRptName As String

[Code] ....

View 14 Replies View Related

Query Based Report Not Showing One Table In Add Field List

Jul 13, 2015

I'm an Access novice. I have a query based report that is based on several tables. All tables are joined by the same field "customer ID," but 1 table is not available under "Add Existing Fields." I cannot figure out why that table isn't available, but I need to add a field.

View 8 Replies View Related

Queries :: Using Combo Box Case To Run Query And Generate Report

Jun 30, 2015

I am create a database to track leave of my team.I have create the tracker and few reports, however now I want to create a report by applying filters in 2 places, for associate and for leave type or for associate and for joint leave or for associate and for Informed.I have SQL code which does not work. how can I select the other paramater with associate name using combox box in form.

Code:

SELECT Leave_Records.[Absent Date], Leave_Records.[Associate Name], Leave_Records.[Absent Day], Leave_Records.[Leave Availed], Leave_Records.[Joint Leave], Leave_Records.[Informed TL], Leave_Records.[Leave Type], Leave_Records.[Leave Applied], Leave_Records.Comments
FROM Leave_Records
WHERE (((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Leave Type])=Forms!Report_Form!Leave_Type)) Or
(((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Joint Leave])=Forms!Report_Form!Joint_Leave)) Or (((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Informed TL])=Forms!Report_Form!Informed));

View 1 Replies View Related

Queries :: Form List Based On A Query Returns Original ID Value Not Field Text

Aug 14, 2014

I have a table x where the field value is selected via a combo box in a form that is populated from another table z.

When I look in x, it appears to have correctly stored the text from z, not the ID number.

I then built a Query, qX, which looks in x and grabs the fields I want. That query shows the text correctly in each selected field.

Now when I build a form, frmQx and use a List control, it displays some of the fields as ID values from the original table z, not the text values.

How can I get round this? I've searched and searched for an answer, sigh. Maybe I'm just not quite certain how to phrase the search.

View 5 Replies View Related

Queries :: Sort Crosstab Query Columns And Generate Report

Jul 28, 2015

This is a query, report and vba question. I'm using Ms Access 2007.

TABLE 1: projectname, activityname, totalhoursworked, employeename
TABLE 2: employeename, employeelevel
TABLE 3: employeelevel, rate

I created a select query to join the info that I need.

SELECT QUERY 1: projectname, activityname, employeename, totalhoursworked, rate, cost (calculated field (totalhoursworked*rate))

I have 2 crosstab queries.

CROSSTAB QRY 1: ROW (projectname, activityname) COLUMN (employeename) VALUE (totalhoursworked (summed))
CROSSTAB QRY 2: ROW (projectname, activityname) COLUMN (employeename) VALUE (cost (summed))

I then created a 2nd select query with inner joins to join both crosstab queries on similar fields (activity & projectname).

SELECT QUERY 2: projectname, activityname, employeename (totalhoursworked as value), employeename (calculatedcost as value)

It gives me this:

However, I want it like this:

Those employeename... refers to more employees being added after a period of time. Hence I want to know if I could use vba to generate a report every time a button is pressed on a form? I know how to link the form to the query.

View 8 Replies View Related

General :: Monthly Cleaning Program - Crosstab Query To Generate A Report

Jun 12, 2012

I want to create a report for the Monthly cleaning plan of a hotel. For each day, how many rooms need new sheets, how many need new towels etc.

At this point I can generate a report for any given day.

This could be an example of what I want to achieve

Code:
------------ Date | Date+1 | Date+2 | Date+3
New Sheets 2 1 0 2
New Towels 1 3 0 1
Full Clean 0 1 2 0

"Date" is a date tat you can set, after which you'll get the following 30 days("Date+1","Date+2" etc)

I thought that a CrossTab query would give me what I want,but using the wizzard I can't get the result that I want.
Haven't worked with crosstab queries before so maybe I'm doing something wrong, or maybe this isn't even possible with a crosstab query.

View 4 Replies View Related

Reports :: Generate Number Of Rows In Report Depending On Number In Another Field

Nov 4, 2013

I have a form where we fill in information for supply of equipment to employees.

Each item must be signed for on a printed report.

I am encountering problems trying to create enough rows in my report detail for each signature of the items supplied.

For example, on the form I will select the "equipment" - 4 hats supplied and 3 boots. On the report I want the equipment set as the group and the detail to be a number or rows which equals the number of selected items. therefore under the Hats group heading I want 4 blank rows which are made up of 3 text boxes - Print Name, Signature & Date and another group heading for boots but with 3 lines.

View 11 Replies View Related

Generate A Field In Query With Hourly Incremented Data Between MIN MAX Interval

Aug 12, 2015

How can I put a field in my query, with all data hourly incremented between 01 January 2015 to 31 December 2015.

View 5 Replies View Related

Print A Report Based On Text Box Parameters

Nov 7, 2005

I am trying to create a report based on a table field called "ClassNo".

I would like there to be a pop up that asks for the begining and ending "ClassNo".

View 2 Replies View Related

Reports :: Filter Report Based On Text Box

May 26, 2015

I have a database which have tbl1 with field admission year with data like august/2007, august/2008. i have entered all data with form1. My problem is that i want filter report. user click a button so a form opened and than he entered data in a text box like august/2007 when he click on show report button only those pages which have august/2007 text will display in report. second time when user change text like august/2008 in text box report also show changes.

View 5 Replies View Related

Queries :: Query To Run Before Report Based On Criteria Based From Two Combo Boxes On Form

Mar 20, 2013

I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.

View 3 Replies View Related

Reports :: Choosing Which Report To Run Based On Text Box Criteria?

Nov 10, 2014

I have a form with a command button that runs a report. I have been asked to modify things and if the data in the text box is "A", run report "A". If the data is "B", run report "B" and so on.

View 3 Replies View Related







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