Print Text Based Upon Field Contents

Jun 23, 2006

I want to print text based upon the content of the field but need more than the IIF statement. For example, if the field contains an "A" I want to print "Active", "C" I want to print "Closed", "N" I want to print "New", etc.

Thanks in advance for any help. You guys have always had an answer in the past!

View Replies


ADVERTISEMENT

Contents Of A Field Based On The Contents Of Another Field

Jul 14, 2006

Hi,
I'm making a form where the contents of a field is determined on the contents of another field in another form. I thought an IIF function would work, but when I tried it the contents says #NAME.

I put it in the control source.

IIF([Forms]![Frm_NewBusiness]![Page4]![Child51]="NTU",NewBusiness_Date_Issued="NTU",NewBusiness_Date_Issued)

Any ideas?

Cheers,
Ben

View 1 Replies View Related

Reports :: Average Contents Of A Field Based On Another Field

Oct 2, 2013

I have a report that has multiple fields - 3 of which matter for this discussion -

1.) employee
2.) employer
3.) rateofpay

The employer field contains 1 of 2 options. For the sake of this conversation, lets call it ABC123 and XYZ123

I need to be able to calculate the average rate of pay for ABC123 company, and exclude the rate of pay for XYZ123 company in my report.

I am calculating this in a section footer.

View 2 Replies View Related

Tables :: Autopopulate Field Based On Contents Of Another

Sep 12, 2013

I am in the process of revamping an old database. I have a main table that currently has two fields "Name" and "Job" but will have more. I have another table with the same fields. I want to use as a lookup to populate the main table with a user form from the second table. I can populate the "Name" field using a combo box, but my problem is how to autopopulate the "Job" field. E.g. If the user selects Mr Smith from the "Name" drop down list, the corresponding "Job" populates the second field.

View 4 Replies View Related

Restricting Data Entry Based On The Contents Of Another Field

Sep 22, 2005

Hello,

I have two tables which contain the following fields (simplified);

Table 1:
ID
Startdate
Enddate

Table 2:
ID
Unitdate
Treatment

The tables are related (one-to-many) through the ID field.

In operation, the user first enters the Startdate and an Enddate for a patients' hospital stay in Table 1. Following this, the user enters the Startdate again in the Unitdate field in Table 2 and selects a Treatment from a drop-down list. After this, the user enters the following in the Unitdate field and selects a treatment. This is repeated in consecutive order until the Enddate is reached.

The end result looks like this;

Table 1:
ID Startdate Enddate
123456 01/01/2005 04/01/2005


Table 2:
ID Unitdate Treatment
123456 01/01/2005 Ventilation
123456 02/01/2005 Ventilation
123456 03/01/2005 Haemofiltration
123456 04/01/2005 Ventilation

Does anyone know if there is any way to restrict the Unitdate field in Table 2 to only allow dates to be entered that are between the Startdate and Enddate fields in Table 1? Ideally, I would like the Unitdate to populate automatically with the dates, starting with the Startdate value and ending with the Enddate value and filling in all the intermediate dates. Also I would like to make sure that there is no way of having duplicate dates in the Unitdate field.

If anyone can help, I would be extremely grateful.

Best wishes
Russell

View 7 Replies View Related

Put Contents Of Field Off Table On Report Based On Date

May 24, 2012

I have fairly large table called QBInvoices that consist two fields- qbinv and date . Also, I have a report that showing info off query called TotalQueryQB. The table and query have no relations except dates . I need to show on report filed qbinv off table QBInvocies on the top of the reprot based on date. The user type date on form -frmQB text box txt Date and I would like to have contest of field qbinv off table QBInvocies on the top of the report base on date that was typed.

View 2 Replies View Related

Viewing Entire Contents Of A Text Field

Oct 25, 2004

I am trying to view the contents of a text field in a form. The field can only be a limited size in the form, but I want to store a lot of text in the field and have it visible without having to enter the field and use the arrow keys to view the contents. Is it possible to programme a function that shows the contents of a field when I roll the mouse over it or something like that? The "Control Tip Text" is the principal of what I am trying to do except this gives a fixed value. When used in web page development I think this function is refered to as "Alt tag"

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

Print List Box Contents.......

Mar 24, 2006

...seems such a simple thing to do but I'm completly stuck. Everything I've found on the forum suggests alternatives to doing to above i.e. setting the query that produces the list to produce that report print directly but that wont work for this situation unfortunately.:eek:

Some background....
I have a form (lucky me) in which the user enters 3 category levels and a branch id, they click a button to generate a list of 50 random stock ids so they can be checked at the branch. A preview of the Stockid's (along with description and Stocklevels) is shown in a list on the form. The stock manager then needs to print the list box contents. If the query is re-run it will differ from what is shown in the list so I need to avoid this.

Any help greatly appreciated.....;) :confused: ;)

View 2 Replies View Related

General :: Button To Print A Report Based On Text Box Values On Form

Jul 11, 2015

Im using a button to print a report based on a text box values on the form.the code for which is below

Code:

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.OpenReport "Labels", acViewNormal
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "Labels", acSaveNo
DoCmd.SetWarnings True
End Sub

The problem that I am getting is not only is the label printing but so is the form.

View 3 Replies View Related

Reports :: Print Two Different Formats Based Upon Value Of A Field

Dec 20, 2013

FoodStamps This is a YES/NO field (printed in the first or second columns).FSAmount This is a numeric field(always printed in the third column).I have a preprint form with three columns.The first column is for a YES answer and I want to print YES if FoodStamps is TRUE.The second column is for a NO answer and I want to print NO if the FoodStamps is False.The third column is either blank if the first column is YES or the actual value if the second column is a NO

Two cases:

If FoodStamps is TRUE then print

YES Blanks
I have a preprinted form and I want the YES in the first column and blanks in the third column on the form regardless of what is in the fieldFSAmount

If FoodStamps is False then print
NO value in FSAmount

the NO in the second column and the value of what is in the FSAmount field printed in the third column.I tried to figure it out with conditional formatting with no luck.

View 1 Replies View Related

Forms :: View / Print Reports Based On A Field In Form

Jul 23, 2015

I am working on a DB that will have multiple reports available. What I would like to do is to have a form that lists the reports available from a reports table. In other words, each detail line of the form will contain a report. I would like to have a button or link placed in the detail line that will open the report for that detail line when it is clicked. This will keep me from having to add a new line to a static form every time I add a report.

I have tried the DoCmd.OpenReport command, but it requires a report name, and I can't find where you can place a field name variable in the command line. I have tried other things I have seen here, but none have done the trick.

View 3 Replies View Related

Reports :: 1 Field Value Print Several Text Box Or Label

Dec 9, 2013

I have one field in my table "Id". Here I have inputed 16 digit number always. Can I print out every digit with different text box or label in my report?

View 4 Replies View Related

Yes / No Field When Active Print Text In A Report?

Apr 8, 2014

I've got a "Made in the USA" yes/no toggle field in my database. When I go to print out the info in a report, I'd like for the report to recognize whether I have a true/false condition, and print out "Made in the USA" where appropriate?

View 2 Replies View Related

Selecting A Name Based On Table Contents

Apr 25, 2008

Hope this works, The table is as follows, ish

Name1 y/n1 y/n2 y/n3 y/n4 y/n5
a...........y......y....n.......n.....n
b...........n......n....y.......n.....y
c...........y......n....n.......n.....n
d...........n......n....n.......n.....y
e...........y......y....y.......n.....y
f............n......y....n.......y.....y
g...........y......y.....y......y.....y


what i need to be able to do is take a form/query answer some questions, y/n1= y/n2= y/n3= ......

Then off the back of this be able to pull out the correct item from column name1.

But i don't need an exact match on all columns. If i am only interested in y/n2=y i need to display all matches

My head says the following If y/n2=y and y/n3=y Then Name1 = e and g
or another example if y/n2=y and y/n4=y and yn5=y Then name1 = f and g

if a y appears in more columns it doesn't matter but it has to be in all those columns i am looking at

can anyone suggest the simplest way forward on this.

View 1 Replies View Related

Print Date Range On A Report Based On A Non-date Field

Aug 7, 2005

Is there a way to show the earliest and latest dates of a report generated by a non-date field?

E.g. I generate a report based on Food, and it'll list the days that this food is associated with. Is there a way to show the first and last day that appears in this report (i.e. the range of dates that the report shows based on the food selected)

View 2 Replies View Related

General :: Render Text Box Contents In Italics?

Jul 14, 2012

I've set the 'Font Italic' method to 'True' for my 'scientific_name' text box control in a datasheet form. It does not render in italics. I've gone so far as to create an On-Load sub with a single command:

Me.scientific_name.FontItalic = True

The control still does not render in italics.

View 3 Replies View Related

Calculated Field Based On SQL In Text Box

Feb 13, 2005

Hello, Bit of a newby to all this. Am trying to use a text box as a calculted field. I am doing so using an sql statment in control source The sql stat is built and tested using build query and then copied and pasted from sql view)

I keep getting #name? as an error.

I have managed using dlookup of the same saved sql to return the required value (which works) but find it to be a bit slow and clunky so wanted to give this a go instead. If somebody can have a look at the query below I would much apreciate.

=(SELECT Sum(QryInout!CostExVATGBP) AS TTlCostExVATGBP
FROM QryInout &_
WHERE (((QryInout.StockImportNoJoinToAll)=[Forms]![FrmSPurch]![ImportNoNew])) &_
GROUP BY QryInout.ProdType &_
HAVING (((QryInout.ProdType)="Freight"));)

Note that I have tried with and without the &_ and also with or with out the brackets..

Thanks

View 4 Replies View Related

General :: Text Box Based On Field Value

Jun 26, 2013

Is there a way to have a text box filled out based on the value of a field. There will be only 2 possible phrases for the text box.

=IF( <Expr> Forms![Workorder]![Disposition])=("Return As Is","DISAPPROVE","APPROVE")

This is what I have tried but I get syntax error.The form is Workorder and the field is Dispostion. When the Disposition is "Return As Is" then I want to have the text box yield "DISAPPROVE" otherwise it should be "APPROVE".

View 14 Replies View Related

Return Value From A Table Based On A Text Field

Aug 27, 2006

I have created a text field on a form that uses the DateSerial function to return the value of last month e.g. Jul-06.

I have a table that contains months (e.g. Jul-06, Jun-06 etc) and a corresponding numeric value (e.g. 1,2,3).

I have another text box on the same form that I want to display the numeric value in based on the value that has been returned by the DateSerialfunction. What properties/control source should I set for this field? Or do I need to write some VBA?

Any help would be appreciated.

View 2 Replies View Related

Modules & VBA :: How To Append Text To A Text File With The Print Statement

Jun 5, 2013

I'm trying to figure out at what point an error message occurs while a database is closing. This problem only occurs if someone clicks on the red close button on the top right of the screen when there are several forms open. If the user exists normally there is NO problem.

I am attempting to use the print statement to write to a text file to track what is happening as the database shuts down. Unfortunately, the open (print) statement, when issued, zaps any prior contents which precludes having a full printed record. I am hoping for a print syntax that would allow appending.

Code:
Open "ErrorReport.txt" for Output as #1
Appended text to the file to show what is happening in that event.
Close #1

The program, in closing, does stop with an error message that a certain file can't be found. But when I click on debug, the program simply closes. I have also commented out VBA references to the file that can't be found, but the error still persists .

View 2 Replies View Related

Modules & VBA :: Code To Check Contents Of A Field In A Table Where Another Field

Sep 11, 2013

I am trying create some code that checks if the contents of the status field in a table is "Authorised" where the ID = something specific for multiple records. If all records witht the specific ID are "Authorised" Then generate a new record in another table. Where to start, perhaps a Dlookup?

View 1 Replies View Related

Selecting Based On A Text Field And Most Recent Date

Jul 16, 2007

Hello, I'm working with SQL and databases in general for the first time, and was wondering: how would I select just the most recent entry for each device? my data looks [roughly] like this:

device1 data_1a 15.2.2000
device1 data_1b 15.2.2001
device1 data_1c 15.2.2002
device2 data_2a 15.2.2000
device3 data_3a 15.2.2001
device3 data_3b 15.2.2002

So what I'm looking for is:

device1 data_1c 15.2.2002
device2 data_2a 15.2.2000
device3 data_3b 15.2.2002

Thanks for any help you can offer!
-Eric

View 2 Replies View Related

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

Selecting Records Based On Part Of A Text Field

Oct 12, 2006

I'm working on a table which has a country field, but this field may contain a text string consisting of more than one country, eg "France, Belgium, Spain"

I want to run a query against the table to select records for any one country, but not sure how to do this.

Any suggestions please?

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







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