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 Replies
ADVERTISEMENT
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
Dec 10, 2013
I'd like to further automate our invoicing system and need a field which has the last day of the month an item was completed.
Currently we have a field in the table called [Date Done]. I'm planning on adding a further field [Tax_Point].
I'd like the field to select the [date done] value and enter the final day of that month, unless, the final date of that month is in the future. in which case it would need the current date.
We create invoices at sporadic times of the month, and in the next month for the previous month; hence the need for a system date check.
View 5 Replies
View Related
Jul 31, 2007
Hello,
I asking to see if it is possible to run a query on a memo field. For an example I want to pull all records where the memo field contains the word "Test".
Is this possible?
Thanks!
Fen
View 1 Replies
View Related
May 17, 2005
I have an application that has a text box on a form that points to a memo data type.
On the form, I wish to allow the users to insert the system date with a short-cut key. (Trying to use Ctrl-D).
I have coded a Keypress Event that checks for the Ctrl-D. "Current" code is below:
===============================
Private Sub PM_Comments_KeyPress(KeyAscii As Integer)
Dim MyString As String
Dim MyDate As Variant
'Check to see if user pressed Ctrl-D
If KeyAscii = 4 Then
MyDate = Date
MyString = Format(MyDate, "Short Date") & ":"
SendKeys ("") ' Perhaps I need to dump the Ctrl-D in the buffer???
SendKeys (MyString)
End If
End Sub
==================================
I say current because I have tried MANY variations. The code is executing properly on the Ctrl-D. I have watched the variables in debug mode and they contain what I want, namely "mm/dd/yy:" for the current date. Problem is, it inserts the TIME in the memo field. And it is the system time, not the integer of the date formatted into the time.
Crazy thing is, in debug mode, the darn thing will do what I want and insert the date in the VB editor page. Just won't do it in the memo field on the form.
NCWalker
View 3 Replies
View Related
Sep 7, 2006
i'm wondering if anyone has a solution to date stamp a memo field every time information is added.
e.g.
9/7 11:03 AM>1st sample information added 9/8 10:30 AM>2nd sample information added 9/9 2:34 PM>3rd sample information added
Any suggestions?
Thanks in advance,
Mark
View 4 Replies
View Related
Dec 15, 2005
We have a memo field that we use for on going notes.
Each day they may type more notes.
Is there a shortcut key, a button, or a way to automatically enter the date
and time before the notes?
View 1 Replies
View Related
Jan 31, 2006
I have a memo field on a form. I am trying to autopopulate it when entered into. For example: I enter in clients info and then tab to the memo field and it automatically enters date and time. Then later when I go back to that same record to append to the memo field it adds the current date. This way I can go back and see all the dates and times when that person called. Any idea how to do this? Thank you
View 5 Replies
View Related
Oct 15, 2004
I would like to create a memo field which automatically enters the date prior to any text input from the user.
Also allow dated updates in the same field
Many thanks
View 2 Replies
View Related
Jan 27, 2015
I want to find out the last 6 months date from todays date. So as todays date is 27th january 2015 so the code should give me the date which is 6 months back from todays date so it will be something like 27th July 2014.
View 1 Replies
View Related
Dec 7, 2006
I have a memo field which records the events that happen on a form. So for example when a user changes the assignment from one user to the next, a row is written to the memo field indicating date, time, windows logon and then a brief description
Basically I end up with :
07/12/06 11:16:34 kleaves : Assigned user changed from Joe Bloggs to John Doe
At present every new row is added to the memo field at the end, so the most recent action is at the bottom.
How can I sort this so that most recent is at the top.
View 8 Replies
View Related
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
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
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 4 Replies
View Related
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
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
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
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
Aug 21, 2007
I have a date/time format field.
"8/21/2007 10:02:34 PM" is what my column shows.
What would I add to the criteria to the query to find all records added today?
at the end of the day my user needs to run a query that will show everything from today. Thanks.
View 5 Replies
View Related
Mar 18, 2015
I need to find whether a memo field contains a specific word. I know how to find whether it contains a specific string.
Let's say I am looking for the word "run." I would not want a positive result when searching "I don't like gerunds," but I WOULD want to find the records with "I know how to 'run' a search."
So I am looking for WORDS, not matching strings.
I am perfectly willing to use a user-defined function, to put involved processing into the query, such as
Code:
...
WHERE FieldHasWord("run", memoField) = True
AND ...
View 3 Replies
View Related
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
Jun 5, 2014
Is there a function I could use to find the date listed in the "date created" property of an Access file?
View 4 Replies
View Related
Mar 16, 2015
I'm lost on how to use the LIKE to find a value in a field.
I try to use the open folder if a field contains "Retail" or any other containing as a part. So, I could have just "Retail" "New Retail" and then act on it.
How can I use the below proper?
Code:
If Me.Business_Type Like "*" & "Retail" Then
View 4 Replies
View Related
Jul 11, 2015
If I have four date Fields in a query, Astart, Bstart, Cstart, and Dstart and want to have a calculated field to find the latest date for each record how would I do that? I have tried things like:
LatestDate: MAX(Astart, Bstart, Cstart, Dstart).
View 2 Replies
View Related
Mar 25, 2015
I want VbA code to find a date 1 less than todays date taking into account weekends/Bank Holidays.
View 8 Replies
View Related
Jul 18, 2015
Is there a way to write a code or query to find the last value in the last Field (column) of a record in a table?
Or find the last field name that contains data, in a record?
View 5 Replies
View Related