Queries :: Insert Carriage Return

Apr 13, 2014

I am trying to reformat a string of text so that it is easier to read on a report.Based on the text, it seems like the best thing to do is to insert a carriage return before a date/time stamp.Here is the data (it's a conversation log)...it is three unique conversation log entries:

04/13/2014 8:21PM - all work and no play is no fun - Bob Smith04/13/2014 8:21PM - this is a test of the emergency broadcast system - Bob Smith04/13/2014 8:20PM - log testing - Bob Smith

If the carriage return is before the date/time string, then all entries would look the same. If the carriage return is after the date/time string.A user had suggested a child table to break out the data into separate records, but I'm sad to say that I never worked with child tables. Any way for replacing 'Date/time stamp' with 'carriage return' & 'Date/time stamp"

View Replies


ADVERTISEMENT

Queries :: Carriage Return - Format Data So It Will Export With 2 Decimals?

Nov 4, 2014

When using the carriage return how do I format the data so it will export with 2 decimals?

In the example below I need the Estimated Material Cost to export in in format: 500.00 --- NOT 500.

MTLCost: [Estimated Material Cost] & Chr(13) & Chr(10) & [C]

View 8 Replies View Related

How To Do A Carriage Return

Oct 4, 2005

Hi guys

Im trying to set my label to a string.

Something like

myLabel.caption = StringOne & chr(13) & StringTwo

The problem is I just get funny symbols instead of the carriage return.

Please help

Thank you in advance

View 2 Replies View Related

Form Updates With Carriage Return

Mar 19, 2005

I have a bound form which opens as a new record. If I accidently press carriage return by mistake whilst entering it goes to another new record, how do I stop this behaviour?

I only want the record to save with the click of a button.

regards in advance
Peter

View 6 Replies View Related

Carriage Return/ Line Feed

Dec 31, 2006

Dim f As Form
Dim g As Form

Set f = Forms!frmInputBox
Set g = Forms!frmCalendar

g("Text" & f!InputDay) = f!InputText & vbCrLf& & f!InputText2


e.g: InputText is 123, InputText2 is abc
I wanted to display the text inside textbox of frmCalendar as:
123
abc
instead of 123abc. how shall i use the vbCrLf?

View 9 Replies View Related

Modules & VBA :: How To Cancel Carriage Return And Replace With Tab

Jul 30, 2015

How i can cancel the a carriage return and replace with a tab or stop it moving down my subform and make it move the the next field instead of going to a new line.

I am using the Keydown but don't know how to cancel it, it just bring an message but it stops it moving to a new record,

Code:

Private Sub Barcode_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
MsgBox "rtn pressed"
End If
End Sub
End If

View 5 Replies View Related

Modules & VBA :: Sending Email - Carriage Return Not Working In Message Body

Jul 9, 2013

I am sending an email from a button, and it runs a word merge and then attaches that word document and two others two an email. All that works fine, but in the body of the email the carriage return is not working.

I've tried "vbCrLf", "Chr(13)" and "Chr(10)". but none of them are working in this email. I use vbCrLf all of the time in many other emails and it works fine.

Code:

Public Function SendEmailFinancial()
Dim MessageBody, vAttach1, vAttach2, vAttach3, vTo
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

[Code] ...

This is what the email is looking like when it comes out:

Project ID: 2013YG00229 Project Title: Toolbox Talks Construction Safety Guides and Mobile App Program Manager: Shana Peschek I am attaching three (3) forms that are needed in order for the State of Washington to process grant payments for your organization for the purposes of carrying out the activities outlined in your final approved application.

View 1 Replies View Related

Modules & VBA :: How To Insert Carriage Returns In Body Text Of Email

Sep 9, 2013

I have developed a private sub which automatically creates an email when a button is pushed.

The code is working well, but I need to insert Carriage Returns in the Body Text of the email just before the word "Please" where it appears in two places. Is this possible?

The code for the private sub is below.

Private Sub PublishROI_Click()
On Error GoTo Err_PublishROI_Click
DoCmd.SendObject acSendReport, "PSR_Rcd_of_Investigation_Rpt_Publish", acFormatPDF, Me.txtEmail & ";" & Me.txtRMEmail, Me.StorageEmail, , _
Me.txtPSRNum, _

[Code] ....

View 3 Replies View Related

Queries :: Search By ASCII Codes - Records Have Double Quotation Marks And Carriage Returns

Jun 27, 2014

I import data through different files into a table, the data comes in different formats. I have a problem sometimes some records have double quotation marks and carriage returns. I know how to replace them as

Carriage Returns

Replace([FieldName],Chr(13) & Chr(10),""

Double Quotation Marks

Replace([FieldName],Chr(34),""

But if i want to use an iif statement because in the field there could be a Double Quotation Mark or Carriage return then it does not find the record

iif([FieldName] like Chr(34),Replace([FieldName],Chr(34),"",[FieldName])

View 2 Replies View Related

Get A Return Value With An INSERT

Oct 2, 2007

Is there a good way to return an id that is created when I insert values into a database?
So I have this: INSERT INTO assignedReview ( reviewUser, reviewedEmpuser) VALUES (@reviewUser, @reviewedEmpuser);
And from that I want to get the reviewID that is generated (setup as a random autonumber) on the INSERT to pass back the user.

View 3 Replies View Related

Address Lines And Carriage Returns

Aug 11, 2007

I want my query to output an address in one field with carriage returns, where the address lines in the source table are held in individual fields.

So I try...

SELECT [Address1] & Chr$(13) & [Address2] & Chr$(13) & [Address3] etc..

This does not work.

However, if I use a text box on a form, with "New Line in Field" set, and then in code use Sendkeys to post the address and the carriage returns as above, it does work.

Can this be done simply in a query? If so how?

View 1 Replies View Related

Reports :: Carriage Returns Ignored In Report Text Box

Aug 2, 2013

The following code is in a text box on a report in a database that creates work contracts. The IIF statements and Dlookups pull the parts of the text together perfectly, but why the new line and carriage returns are completely ignored in the last section? Been working on this all day and we can't find a way of inserting 2 new lines!

Code:

=DLookUp("Description","QFRCL07") & (IIf(DLookUp("Description2","QFRCL07") Is Not Null,DLookUp("BasicSalary","Tmain","ContractID=ContractID") & " " & DLookUp("Description2","QFRCL07"),"")) & (IIf(DLookUp("Description3","QFRCL07") Is Not Null,DLookUp("Job","Tmain","ContractID=ContractID") & " " & DLookUp("Description3","QFRCL07"),"")) & (IIf([Forms]![FFRRCheck]![Text305] Is Not Null,(Chr(13) & Chr(10) & Chr(13) & Chr(10) & [Forms]![FFRRCheck]![Text305]),""))

View 5 Replies View Related

Queries :: Insert Into One To Many PK And FK Insert

Mar 25, 2015

I have a normalized DB with one to many relationships, using Primary and Foreign Keys.

I need to do inserts and maintain the PK/FK relationship, which means when I add a new PK I need to insert that PK as FK in other tables in the same transaction.

How do I do this in Access? SQL Server I use transactions, but I can't lock up the tables in Access like that.

I did a bunch of searching and found nothing, which leads me to believe I am way off in my thinking. Below are the dirty details

I have 2 tables, tblName and tblPhone. 1 name can have many phones.

tblName has PKName. tblPhone has PKPhone, FKName.

I have a form where user enters a new Name and PhoneNumber.

Name gets inserted to tblName, assigned with PKName = 100

Phone should get inserted into tblPhone with PKName.

IE Insert into tblPhone (FKName, PhoneNum) VALUES (100,"212-555-1212").

The dumb way I am doing it now is I insert to tblName, query tblname for the PK, then write to tblPhone. This can't be right.

View 2 Replies View Related

Queries :: Return One Value Or Another

Nov 20, 2013

I am looking up a product based on a unique code in tblProducts...I need to return one of two values

If the value of [Product type] = "multi" then return "multi"
else
If the value of [Product type] = "solo" then return the value of the non empty field in a range of fields

for example

tblProducts
PID (key) | PACKAGE TYPE | RED | YELLOW | BLUE
C13T0714010 | single | <empty>| yellow | <empty>
C13T0754010 | multi | red | yellow | blue

query
C13T0714010 returns "yellow'
C13T0754010 returns "multi'

View 13 Replies View Related

Queries That Return No Records

Jan 31, 2006

Hi All,

I am wandering if it possible to check programatically whether a query returns a NULL result?

I am writing a program(VB) that involves an IFF statement where if there are records in the query it does a specific calculation & if there are no records returned in the query it does something else. Is this possible to achieve?

Thanks in advance:D

Cheers,

Karv

View 2 Replies View Related

Queries :: MIN (00) Or MAX Value To Return In Same Column

Jun 10, 2015

I am having an issue with a select query as I want one column to show the MAX and "00" value of the same Column. How do I go about having this task completed.

For example, the column has 00,01,02,03,04,05,*1,*2,*3,*4,*5 so I want a query that will return values of "00" and "05" on this example
00
05

Further example, this is what I have now

SELECT qryPR34_UNION.PR34001, qryPR34_UNION.PR34002, qryPR34_UNION.PR34003, qryPR34_UNION.PR34005,
qryPR34_UNION.PR34006, qryPR34_UNION.PR34007, qryPR34_UNION.PR34013, qryPR34_UNION.PR34014,
qryPR34_UNION.PR34098, qryPR34_UNION.PR34099, qryPR34_UNION.PR34100, qryPR34_UNION.PR34101
FROM qryPR34_UNION
WHERE (((qryPR34_UNION.PR34002)>"0") AND ((qryPR34_UNION.PR34003)>"0")
AND ((qryPR34_UNION.PR34006)<"0") AND ((qryPR34_UNION.PR34099)>0));

On the WHERE command, I need field PR34005 to give me the "00" value or the MAX value (on my example the result will have to give me records that have "00" and "05" value assigned on PR34005

View 14 Replies View Related

Queries :: Max Query To Return One Row Only

Mar 20, 2013

I have a query which is a max sum of sales for several sales reps. (If that makes sense?)

Sales Rep, Total Sales
1, 100
2, 200
3, 500
4, 50
5, 150

I need to create a report which delivers the sales rep with the most sales and only that sales rep

e.g.

3,500

View 7 Replies View Related

Queries :: Return More Than One Number?

Oct 24, 2014

i have a query with an inputbox for numbers [Enter Number]..if i want the query to return multiple numbers how would i do this? so the user could have 3 5 and 8 to search for, currently the [enter number] allows them to search for one at a time.

View 1 Replies View Related

Queries :: Return All Records With Last / Max Date

Apr 10, 2013

My issue surrounds retrieving the last (based on most recent date) set of records based on the most recent date. I have query, containing 2 tables as the sources for the query results. Currently, the query yields:

Field A Field B Field C
123456 AAAA 1/8/13
123456 BBBBI 1/8/13
123456 CCCC 1/8/13
123456 DDDD 1/8/13
123456 EEEEEE 3/10/13
123456 FFFFFF 3/10/13
123456 GGGG 3/10/13
123456 HHHH 3/28/13
123456 IIII 3/28/13
123456 JJJJ 3/28/13

The desired results would be to return all records with the last/max date, so yield:

123456 HHHH 3/28/13
123456 IIII 3/28/13
123456 JJJJ 3/28/13

I have tried the max & last functions, yet no success.

View 1 Replies View Related

Queries :: Return Last Record In A Table

Sep 23, 2014

My setup is simple, it consists of two tables:

Employee (one)
Position (many)

So an employee in this database can have many different positions. The tables are linked using an EmployeeID field.

I want to construct a query that will list each employee and the last job entered for them in the database. Right now my query simply returns all the positions held (where there are more than one)?

View 10 Replies View Related

Queries :: Return Values From A List

Feb 12, 2014

I have two tables, TBL_Students and TBL_Email. Each of these tables have a field called Category, which allows multiple values from a list.

Is there a way to return records from TBL_Students where at least one value in TBL_Students!Category = at least one value in TBL_Email!Category.

E.g. If Student A has categories Maths, Physics and Computing;Student B has categories Maths, English and History;Student C has categories Physics and Geography

I would expect:
when TBL_Email!Category = Maths,Physics : Students A,B,C to be returned
when TBL_Email!Category = Maths : Students A,B to be returned
when TBL_Email!Category = Physics,Geography : Students A,C to be returned

View 2 Replies View Related

Queries :: Return All Entries For Specific Day

Jul 6, 2015

I have a large table with millions of entries. I want to run a query to return all entries that are on a Saturday. The date stored in the table though is just typical date format eg 15/11/2015.

View 1 Replies View Related

Queries :: Extract Day From The Date And Return A Value

Feb 20, 2014

I have a list of dates on which tasks were performed.

I want to be able to see if there is a pattern, i.e. lots done on a Monday

Can I extract the Day from the date, and return a value Monday, Tuesday, Wednesday etc??

View 3 Replies View Related

Queries :: SQL Will Only Return Maximum Of One Result

Aug 29, 2013

Why this SQL will return only one query maximum?

DateLimiter: (SELECT Date_Retro_Fees_Rate FROM tblRetroFees AS Alias WHERE Date_Retro_Fees_Rate = (SELECT FIRST(Date_Retro_Fees_Rate) FROM tblRetroFees AS Alias2 WHERE Alias2.Date_Retro_Fees_Rate > tblRetroFees.Date_Retro_Fees_Rate AND Alias2.Id_Product = tblRetroFees.Id_Product) AND Alias.Id_Product = tblRetroFees.Id_Product)

A picture of the table is included.

View 1 Replies View Related

Queries :: Find Value In Another Table And Return ID

Aug 8, 2014

I'm currently busy with something for my thesis as a student and I need to use Access for this. I'm not too new at access, I know how to do the very basics, let's say on the level of [if field contains *"text*", return x].

However I am struggling right now on something that shouldn't be too hard... I could do it immediately in Excel if there werent millions of rows..I have 2 tables. Table 1 regards a list of patent publication numbers (eg. WO2012024604A3) and additional data (publication date, title, etc), only the publication number matters for me now.

Code:
Table 1
publication numberWO2011085209A2
WO2011100754A1
WO2011112983A3
EP2342192A4
EP2342192A2
EP2205725A2
EP2205725A4
WO2012006540A3
WO2010008486A3
WO2012083136A1

Table 2 contains another list of patents that might cite/refer to Table 1's patents and additional data such as publication date.

Code:
Table 2
Publication Number Citing PatentsPublication Date Cited Refs - Patent

AU2001287375B2 1998-12-01 US5178882A | US4225581A | WO1998001161A2
AU2001288365B2 1990-02-24 US5967154A | WO1996039117A2 | US3699979A | US3943949A | US3838702A
AU2001288437B2 1999-03-09 US6087157A

[code]....

Now what I'd like to do is to create a third table which has for each of [Table 1].[Publication number]:

Column 2) A count of how many times the [Table 1].[Publication number] is found in [Table 2].[Cited Refs - Patent] ...

Column 3) In case a patent is cited more than once, return the [table 2].[publication Number Citing Patents] value of the earliest citing patent (so with the lowest Publication Date value).

For Column 2 I had expected it to be an easy count(iif( [Table 2].[Cited Refs - Patent] = "*"&[Table 1].[publication number]&"*")) command but apparently it's harder than that..

View 2 Replies View Related

Queries :: Return Number Before Letters

Mar 12, 2015

I would like to run a query which takes a code which contains a mixture of number and letter and returns all the number before the first letter. I was using the left function (=Left(([Codes],2)) but sometimes there is one number sometime two. The desired results are shown below;

7pol2try36 = 7
12cet9fre55 = 12
10yea3gtr77 = 10

Is this possible?

View 3 Replies View Related







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