Modules & VBA :: Check Whether First Line Of A Memo Field Is Empty

Feb 10, 2015

Our quotation tool, which is built in access 2003, has a memo field, which is extracted in a .txt file, to be uploaded by another system.

When the user starts the memo field with a blank line, by hitting the enter key, the upload file writes the memo field as a new line, separating it from the line indicator and thus giving errors.

My question would be : How would I determine in VBA, whether the first line of the memo field is blank.

View Replies


ADVERTISEMENT

Last Line Of Text From A Memo Field

Nov 21, 2006

Can anyone help....

I have a field on an Access db, this is a "Memo " type field which has many lines of text within it.

I need to run a query on this to get the last line of text within this field.

Aside from records where this memo field is filled in I also have records where the memo field is blank. So basically if the memo field is blank I want a blank field returned as well as fields with data.

I am using Access 2003 but also am running this on Access 2000 (not sure if there has been a change to function names)

This is seriously bugging me - can anyone put me out of my misery?

View 5 Replies View Related

Forms :: New Line In A Memo Field

Jun 1, 2013

When I am displaying a memo field, is there any way that I can force a new line? Can I add a character to the text to do that?

View 7 Replies View Related

Update Memo Field With Line Breaks

Jan 6, 2006

I have a memo field that contains several text strings separated by line breaks. I would like to write a query to add another text string to the end of the field. How do I embed a line feed in the SQL?

View 3 Replies View Related

Reports :: Line Breaks In A Memo Field In Report

Mar 21, 2015

I created a form with a memo field. Data is entered. How do I get the data to print on the report on separate lines rather than one continuous paragraph? For example: Entered in form:

2/1/15 visit to house. 2/2/15 ordered new locks for doors. 2/5/15 Locks installed.

Print view on Report:

2/1/15 visit to house.
2/2/15 ordered new locks
2/5/15 locks in stalled.

View 1 Replies View Related

Forms :: Place Cursor At The End Of First Line In Memo Field

Dec 2, 2014

I have created a button that takes the contents of a memo field and adds a new line of text at the top with the date, time and initials of staff member. So far, so good...

However I want it to end with the cursor ready at the end of the first line (to type the note) The following code does everything but ends by putting the cursor right at the end of all of the text in the memo field (instead of the end of the first line):

Code:
Private Sub Command59_Click()
Me.Note = Format(Now, "d mmm yyyy hh:nn") & " - " & "(" & DLookup("[login]", "logintable") & ") " & Chr(13) & Chr(10) & Me.Note
Me.Note.SetFocus
Me.Note.SelStart = Len(Me.Note)
Me.Note.SelLength = 0
End Sub

View 6 Replies View Related

Forms :: Access 2013 - Click On Memo Field And Hit Enter To Go To New Line

Apr 12, 2013

When I click on my memo field and hit enter to go to a new line, it moves to a new record. Where do I look?

View 2 Replies View Related

Modules & VBA :: How To Check Empty Folder

Jun 12, 2013

I use code to check folder as below.

If the folder not exists, then create it.

If dir(myfolder) = "" then
mkdir(myfolder)
end if

How to add code to check empty folder, like below?

If dir(myfolder) = "" then
mkdir(myfolder)

else if empty(myfolder) then //there is no empty function in access
do something
end if

View 2 Replies View Related

General :: Check For Empty Option Group Field

Jul 28, 2012

I have an simple option group (3 options 1,2 and3!!)I am building a query where I need to display records whose option group field in the table is empty. I have tried:

field = Int(0)
field = ""
field = null
isempty(field)

do not work.

View 4 Replies View Related

Modules & VBA :: How To Recognize Empty Field

Sep 24, 2013

Why can't I get this simple piece of code to work?

Code:
Private Sub txtDateBack_AfterUpdate()
' updates loan status
txtLoaned = 0
If txtDateBack = Null Then txtLoaned = 1
End Sub

Code:
Private Sub txtDateBack_AfterUpdate()
' updates loan status
txtLoaned = 0
If txtDateBack = "" Then txtLoaned = 1
End Sub

View 4 Replies View Related

Limit Characters AND Line Feeds In Memo Control

Mar 1, 2006

I have a data entry form with a memo control physically sized to match the allowable space for this information when printed on a report.

Basically, I need to be able to stop the user from further input when the cursor reaches the lower right corner of the memo control. Beeping when reaching the limit is acceptable, but a pop-up message would be ideal.

I have not been able to find a solution that will limit the amount of text displayed in the memo control that will also include however many LF's a user inputs. All of the search results refer to only limiting the number of characters and do not take into account LF's.

I am new to Access and would appreciate all suggestions.

View 2 Replies View Related

Modules & VBA :: Import More Than 300 TXT Files And Add Filename Into Empty Field

Aug 14, 2015

I need to import 300+ individual .txt files into a MS Access DB table (named "tbl_input"). Each of the the .txt files have a naming convention similar to this:

Pink_Floyd_YYYYMMDD.txt

Because this initial import is so large and I would like to avoid doing it manually, I need to be able to:

import each of these files into a single table
delimit the text in each based on the "|" symbol
add the filename into an empty field

View 1 Replies View Related

Modules & VBA :: Read CSV Transaction File Line By Line And Add Correct Transactions To Access Table

Nov 29, 2014

I have a module which reads a CSV transaction file line by line and adds the correct transactions to an access table and places the wrong ones in a logfile.Now some transactions are rejected twice there is even one rejected six times. Whereas one wrong transaction is processed only once. I am certainly overlooking something obvious in the logic but what. Here is the relevant code.

Code:

Function ImportCSVForConfederation(inputCSV, ORG)
Dim TNO As Integer, TACT As Integer, TABLE As String, TLINE As String, I As Integer, J As Integer, K As Integer
Dim FLD1 As String, FLD2 As String, FLD3 As String, FLD4 As String, LogFile As String, LogPath As String
Dim Lim As String, ITNO As Integer

[code]....

View 8 Replies View Related

Modules & VBA :: Set Focus Exactly In Second Line In Text Field?

Jul 23, 2013

how to set focus in first or last line, but I need set to second.

View 11 Replies View Related

Modules & VBA :: Parse Records From Memo Field

Jul 8, 2013

Access 2003

I have a process which imports a txt file into a memo field of my TBLORIGINAL table Each file may have one record or it may have multiple records Every record begins (exactly) with

Quote:

FRE Order Order RAD ShipDate Customer City State Postal Code

For each record in the memo field, I need to create a new record into my TBLPROCESSED table

This can probably be done while it is importing but I need to keep the original file intact

I suppose I could copy and paste but there must a vba way of doing this

View 3 Replies View Related

Modules & VBA :: Hyperlink Text In Memo Field

Apr 11, 2015

I want to create an app that works like Wikipedia. for example any word that have an explain and that's explain available in my database that word become hyperlink text with different color and so if operator click on that word open a new form and show the explain.

View 1 Replies View Related

Modules & VBA :: Find Each Date In A Memo Field

Jul 21, 2014

Memo field is called [Notes] and data is like this...

5/05/14 - Perry was on another call. LM 2/05/14 - Perry only at centre in the mornings, need to speak to him before sending samples. 13/06/13 - Perry in a meeting. lm 30/05/13 - See Little Hampton Early Learning - s/w Perry, has already received sample and info 29/05/13 - s/w Aspi, said to cb tomorrow and speak to Perry

I want to find each date in the Notes field so I can split the memo field data into another table where the memo field will become multiple records that hold date, text and customer/prospect ID fields. The customer table was easy because there was a <Div> tag before each date. However in the Prospects table there are no tags so how to change my vba code to search for each date before I split off the data.

Here is the part of the VBA code I used to find the <Div> tag in the customer notes field. How to find each date in the memo field? The date is in d/mm/yy format?

If Not rst.EOF Then
Do
StrSplit = Split(rst![Notes], "<Div>")
For x = 1 To UBound(StrSplit)

View 6 Replies View Related

Modules & VBA :: How To Import Text File Line By Line

Nov 18, 2014

I am having a little difficulty with my importing in Access. Every time I import my text file, the lines will be jumbled. I have been reading up and I found this recordset code that seems to be what I need:

Code:
Dim strLine As String
Dim intLineNum As Integer
Dim MyDB As DAO.Database
Dim rst As DAO.Recordset
Open "C:TestTest.txt" For Input As #1
Set MyDB = CurrentDb
Set rst = MyDB.OpenRecordset("tblResults", dbOpenDynaset)
CurrentDb.Execute "DELETE * FROM tblResults", dbFailOnError 'Clear tblResults

[code]....

Basically, this code will extract data from the text file as long as it fulfills the Mid$ criteria. Here's where my problem comes. Each line in my text file is of different lengths and I have to capture the entire line.

I think using the Left$ function would work, but I don't know how to determine the character count such that the entire line of text would be inserted into the table.

Another difference between what I need and the code above is that, I am required to store each line into each row of my table, meaning

Line 1 is placed in Row 1 Column 1
Line 2 is placed in Row 2 Column 1
Line 3 is placed in Row 3 Column 1
.
.
.
Line X is placed in Row X Column 1.

View 14 Replies View Related

Modules & VBA :: Auto Resize Memo Field In Subform

Apr 28, 2015

I have a subform that I use in a few different ways on my database. It has a comment log with a memo field for people to insert their comments. The struggle is some can be long some can be short. Is there any way to have each record height adjust to the length of the memo?

If it cannot be done for the subform in regular use, my main concern is having it formatted for reports that are generated for clients.

I clipped and attached an example from a report. Its not the best example but the extra column height is adding additional pages to my report to accommodate one long comment.

View 4 Replies View Related

Modules & VBA :: Insert CR / LF In Memo Field Based On Search String

Jan 16, 2014

I import a CSV field which has not preserved the CR/LF when it was exported from BCM Remedy. There is no setting for that. The memo field prints on my report like this:

A custom solution would be developed, that once implemented, could become the standard product in similar situation. Normally would assign to Network Engineering, but will work with Ray and the IPT Team to cost out the solution and get approval to proceed. 2012/05/24 10:44:28 AM PCOLLINS Sent to Ray Massie for review to determine if a solution needs to be proposed, or if they can wait for the National IPT solution to be ready in 2013.

I want to add VBA code that inserts a CR/LF in the memo field before all but the first occurance of a string that looks like a date, the first occurance doesn't need it. I will do it right after I import the CSV file into the table, so it happens only once, and it always prints and displays the CR/LF.

The memo field is called "NBS Update" and the table is called "CCRR Remedy Data"Here is what I have, but don't actually know what to put in to find the date and add a CR/LF:

Code:
Dim db As DAO.Database

Code:
Dim db As DAO.Recordset
Dim srtSQL As String

[code]...

View 14 Replies View Related

Modules & VBA :: Can't Find And Format Section Of Text Within RTF Memo Field

Jul 8, 2013

I had the need every so often to quickly find all instances of any (particular) word within the database, without going to the bother of thinking about where that word/subject might be in the data base, I designed a report which does the job nicely. It uses a search form/control, searches and finds all instances of the word (or words) I have asked it to find, then does a report showing all instances of whatever RTF memo fields that contain the word(s).It has to be RTF memo field because (if I wish) it goes straight into the book text I'm writing, and also it searches the book's RTF memo field.
.
The trouble is, at present, I then have to manually "eye scan" the resulting report to find the occurrences of the "key searched for" word, nestling/hidden somewhere within sometimes quite large chunks of text. I would love to have the report show the found "key word(s)" highlighted in (say) light blue or whatever colour, so that I can quickly & easily lock on to it visually.

I enter the word I want Access to find, into a form called "formfindword" in a text box called Text0. I click on a command box on this form, to open up the report called "Querywhatsandhowschooseword" based on a query of the same name. The query's "what" field (from the main database) has the criteria

= Like "*" and [forms]![Formfindword]![Text0] & "*"

The query's "how" field criteria (in the "or" line of the query design) is also

= Like "*" & [forms]![Formfindword]![Text0] & "*"

I have tried to use the Conditional Format facility in Report Layout view, without any luck.I think therefore that I will need some VBA code (which is totally foreign to me, unfortunately) to make this simple concept a reality.

View 2 Replies View Related

Modules & VBA :: On Click Of Checkbox - Adding Notes To Memo Field

Feb 5, 2014

I have code which is attached to onclick of a checkbox,

What I want it to do is if the user clicks it and checks it then to add some note to a memo field, if the user clicks it and its already checked then it doesn't add a note to a memo field.

Code:
Private Sub Check45_Click()
If Check45 = 0 Then
Check45 = 1
If Len([Forms]![Customer]!Notes.Value & "") = 0 Then

[Code] ....

But I can't seem to add any other lines which make sense to me that it doesnt add "letter sent" to a memo field if its already checked?

View 5 Replies View Related

Modules & VBA :: Access Memo Field Copy To Excel Truncates At 255 Characters

Nov 25, 2013

Two Solutions to address moving an Access Memo field into Excel when string has > 255 characters. All my 'reports' use Excel VBA (Access Reports are not used). The Excel reports can have 40,000 records. Speed to create the report can be an issue.

Describing 2 Solutions below to address moving Access memo fields with > 255 characters into Excel.After running this code

Code:
720 ObjXL.DisplayAlerts = False
ObjXL.Columns("X:X").Select
ObjXL.Selection.NumberFormat = "@" ' set column to Text
730 ObjXL.Worksheets(intWorksheetNum).Cells(intRowPos, 1).CopyFromRecordset rsNutsAndBolts

The Comments column are limited to 255 characters. So, the CopyFromRecordset (recordsetvariable) creates the 255 character limitation.

The reason? The 255 character limit is because CopyFromRecordset sutomatically uses the Characters property of the Range object. The 255 limit would not be there if the Cell Value property is used to assign the string to that cell.

Dim sRx as String ' String Prescription
sRx = "String with > 255 characters ... you fill in the rest ...."
Cells(1, 1).Value = sRx ' Cell's Value property assignment can be very large

Solution 1:

The record set is still in memory. By using a loop, a cursor can start with record 1 (memo column) and assign that value to the Excel row / column using the .value as shown above. Basically, this moves one memo field at a time, record by record. e.g. Read First recordset in Access, copy to variable, assign value to Excel row/column Then move next on each Access and Excel.

Solution 2:

An Access Memo filed [RxNotes] can have up to 750 characters. Cut it apart into three new fields that end up out in the very right Excel columns AA, AB, AC.

Note1=Mid([RxNotes],1,250)
Note2=Mid([RxNotes],251,250)
Note3=Mid([RxNotes],501,250)
Then using Excel Object - Concat the cells back cell by cell...
X2=CONCATENATE(AA2,AB2,AC2))

Then delete the columns AA, AB, AC to hide the evidence..Neither solution is all that elequent. Read about this and by golly, it made a difference

ConcatComments = "'" & CommentString

Before using the CopyFromRecordset be sure to add a single quote in front of the large string.

Turns out the interface between Access and Excel look for this to prepare Excel immediately for the string to be a string, not something else. Some of my strings had weird print characters that kind of looked like Japenese characters. It seemed random, it always happened if the string was 255 or more characters (ramdonly, not always). The single quote doesn't show up in Excel, but got rid of all the noise.

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

Modules & VBA :: Unbound Textbox To Display Memo Field Based On Listbox Record Selection

Apr 21, 2014

My table:

tblHeatTreatment
- HeatTreatmentID - PK
- HeatTreatmentDesc - Text
- HeatTreatmentDetails - Memo

My form has a listbox (lstHeatTreatments - Multi-Select disabled) that displays Heat Treatment descriptions and an unbound textbox (txtHTDetails) that I would like to have display the corresponding memo field when a description is selected from the listbox.

This is my code so far:

Code:
Private Sub lstHeatTreatments_AfterUpdate()
Dim myConnection As ADODB.Connection
Dim myRecordSet As New ADODB.Recordset
Dim mySQL As String
Dim selectedRequirementKey As Long
Set myConnection = CurrentProject.AccessConnection
Set myRecordSet.ActiveConnection = myConnection

[Code]....

When I run the code I get an error:

Quote:

Run-time error '-2147352567 (80020009)':

The Value you entered isn't valid for this field

When I debug, it highlights:

Code:

Me.txtHTDetails = myRecordSet.Fields

View 3 Replies View Related

Modules & VBA :: If Check Box Yes Type Name Of Field In Another Text Box

Jun 9, 2014

i have multpile yes/no check box i want if i check on one the name of this check box is written on another one.
so i neeed a code for loop of check boxes and i need a code i.e loop all check boxes if any is true then put name field in {new field}

View 8 Replies View Related







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