Removing A Value From A Text Field
Dec 7, 2006
I have a form with a unbound text field which when a user inserts text and then removes the focus from that field, the text gets inserted into a memo field. By using:
Me.[NOTES] = Now() & " " & Environ("UserName") & " - " & Text27365 & vbCrLf & Me.[NOTES]
However, I have noticed an issue with this, in respect that when the user enter text then moves to the next record, the previous entered text is still there, This could then cause this old text to get inserted into the wrong record. How can I set this field to blank once it I have moved to the next record or closed the form?
View Replies
ADVERTISEMENT
Jul 30, 2007
I have large sets of data that has labels on them. For example "25.56 lbs". I just want the raw numbers. Can someone help with what to type in the update to field of an update query to just keep the numbers? Thanks
View 2 Replies
View Related
Feb 2, 2006
I have two questionaire forms in a database. There are no tables or queries involved.
The answers to each questionaire are compiled into text boxes, one on each Form. On the main form I have another text box that puts all the answers together so that this can be transferred to another program. An example of what is in each text box is as follows:
Text1: IIf([Check325]=True,[Combo77] & " " & [Combo59] & " " & [Text65] & " " & [Text69],"") & " " & IIf([Check329]=True,[Combo78] & " " & [Combo61] & " " & [Text66] & " " & [Text70],"")
Text2: IIf([Check326]=True,[Combo102] & "" & [Combo188] & " " & [Combo91] & " " & [Text94] & " " & [Text97],"") & " " & IIf([Check330]=True,[Combo103] & " " & [Combo92] & " " & [Text95] & " " & [Text98],"")
These are just small extractions. My problem is, if an answer is not necessary in the first lot of text, but an answer has been supplied in the second lot, how do I remove the spacing that has resulted from my Formula in Text1. -
e.g: Normal answers would show perhaps
Yes Twice 16 25 Red Peter Ford Football 1965 - Whereby the first 4 answers are from Text1 and the remaining answers from Text2.
If some answers are not necessary from Text1 I would get the following result:
SPACE SPACE SPACE Twice Red Peter Ford Football 1965
Any assistance would be gratefully accepted.
View 3 Replies
View Related
May 23, 2006
Dear All,
Thank you for taking the time to look at this Question.
I am using a form in which i only need the last sections.
example:-
G/001 - Ceiling - Tiles - Perforated. this is what i get at the second, but i would like to drop the "G/001 - " and just have "Ceiling - Tiles - Perforated.", has anybody got any ideas on how to do this please.
View 1 Replies
View Related
Jan 27, 2005
Hi, I got this code from a member here (thank you, dbickin!), and I've altered it several times to fit my needs. This time, though, it's not working. My goal is to delete all of the text to the left of "C-W." My previous goals were to delete text to the left of /, -, and (. Maybe it's not working now because C-W is three characters rather than one.
Here's the code... 3 samples of what WORKS, and the last one doesn't.
Function RemoveNote(TextIn As String) As String
Dim TextOut As String ' buffer for result
Dim i As Integer ' index into string
Dim InNote As Integer ' flag showing if we are inside a note
InNote = 0
For i = 1 To Len(TextIn)
If Mid$(TextIn, i, 1) = "/" Then
InNote = Abs(InNote - 1) ' toggle flag
Else
If InNote = 0 Then ' not in note, so copy character
TextOut = TextOut & Mid$(TextIn, i, 1)
End If
End If
Next
RemoveNote = TextOut
End Function
Function RemoveNote2(TextIn As String) As String
Dim TextOut As String ' buffer for result
Dim i As Integer ' index into string
Dim InNote As Integer ' flag showing if we are inside a note
InNote = 0
For i = 1 To Len(TextIn)
If Mid$(TextIn, i, 1) = "-" Then
InNote = Abs(InNote - 1) ' toggle flag
Else
If InNote = 0 Then ' not in note, so copy character
TextOut = TextOut & Mid$(TextIn, i, 1)
End If
End If
Next
RemoveNote2 = TextOut
End Function
Function RemoveNote3(TextIn As String) As String
Dim TextOut As String ' buffer for result
Dim i As Integer ' index into string
Dim InNote As Integer ' flag showing if we are inside a note
InNote = 0
For i = 1 To Len(TextIn)
If Mid$(TextIn, i, 1) = "(" Then
InNote = Abs(InNote - 1) ' toggle flag
Else
If InNote = 0 Then ' not in note, so copy character
TextOut = TextOut & Mid$(TextIn, i, 1)
End If
End If
Next
RemoveNote3 = TextOut
End Function
Function RemoveNote4(TextIn As String) As String
Dim TextOut As String ' buffer for result
Dim i As Integer ' index into string
Dim InNote As Integer ' flag showing if we are inside a note
InNote = 0
For i = 1 To Len(TextIn)
If Mid$(TextIn, i, 1) = "C-W" Then
InNote = Abs(InNote - 1) ' toggle flag
Else
If InNote = 0 Then ' not in note, so copy character
TextOut = TextOut & Mid$(TextIn, i, 1)
End If
End If
Next
RemoveNote4 = TextOut
End Function
Help??
-Siena
View 4 Replies
View Related
Apr 25, 2014
I have a list of consumables;
Syringe 50ml
Syringe 20ml
Syringe 5ml
Syringe Cap
White Needle
I want to remove only the number and the ml part from the list, so I would end up with;
Syringe
Syringe
Syringe
Syringe Cap
White Needle
If I use
PHP Code:
Replace([DrugNameVial],"50ml","")
I get the desired result for the 50ml syringe size.
I have tried every possible combination of "**ml", "##ml", "Like [0-9]ml all with no success.
How this can be resolved without having to individual enter each syringe size "5ml", "20ml" etc
I can't even just take the text from the right till the first space as this would lead to problems with other consumables in the list.
View 5 Replies
View Related
Jan 25, 2006
I use the template service call management . In the work order section there is a field called Entered By . I would like to remove it as I do not need it and if you do not enter it the work order will not complete . Is there a way to remove it or make it so you do not have to enter anything there >> I have tryed to remove it but somehow it is connected to some thing else and I get error
THXS for Help
Steve
View 8 Replies
View Related
Mar 15, 2007
Hi there I am extracting user names from e-mails in an access database.
I built the following command to do it
Left([E-Mails by Source - Test]![E-Mail],InStrRev([E-Mails by Source - Test]![E-Mail],"@"))
where [E-Mail] is the e-mail address.
It works great. But I still get the @ and the end of the name.
Any idea how I can get rid of it (other than using find and replace)?
Thanks for your help.
View 1 Replies
View Related
Nov 29, 2005
Hello,
I want to remove the first four characters from a field in a query.
The data are not always the same length, but it will always be the first four.
Example.
vmc_ml120e21/p -> ml120e21/p
Is that possible and how??
Thanks in advance.
View 6 Replies
View Related
Jan 26, 2006
I use access template service management . In the workorder screen there is a field for employee that entered teh information . I do not wnat to use it I have tried all ways of removing it and get error . It seems to have to be there . Is there a way to remove it ??
Thxs STEVE
View 1 Replies
View Related
Jan 26, 2006
I want to remove a input box from a form that is in the service management template . If I try to remove it I get error . Is there some way I can and not get errors . It is the input for the person that is using the form
Thxs Steve
View 1 Replies
View Related
Dec 28, 2011
I'm using a query to concatenate data from a table into a specific HTML format. I would like, however, to find a way to remove lines of HTML when there is no data in a specific field.
Example:
If I were to create a list of available colors of a shirt like so:
<ul>
<li>[Color1]</li>
<li>[Color2]</li>
<li>[Color3]</li>
<li>[Color4]</li>
</ul>
but if there were only 3 available colors, I'd end up with this:
<ul>
<li>[Color1]</li>
<li>[Color2]</li>
<li>[Color3]</li>
<li></li>
</ul>
I need to find a way to get rid of that last vacant tag. I image there's some kind of code I could write (if x is null, clear line17, or something like that) but I wouldn't even know where to start with that.
View 3 Replies
View Related
Mar 5, 2015
I created a report to print out a letter that will be sent to all of our clients. In the address section of the letter there are two field for adresses...Address1 and Address2. One is for a street address and the other for a PO Box. Not all of the clients have a PO Box and for these, I do not want the blank line to show in the address. For example:
John Doe
3 Main Street
Franklin, MA 02038
The field and section of the report are set to "can shrink" and "can grow", but it still gives me a blank line in the address for the clients that do not have a PO Box. What else do I have to do?
View 8 Replies
View Related
Jun 18, 2014
I am very new to access less than 1 week since i started trying to build an horse racing database, i am trying to link data from 2 different sources via the horses name however one source displays this with the horses country of origin in parenthesis foe example FRANKEL(GB) and the other source displays the name as just FRANKEL, to be honest i haven't yet tried the link but guess it will fail.
I am therefore looking to get rid of the parentheses and their contents from an access table field and create another field without them.
In Excel i use the formula B1:
=TRIM(REPLACE(A1,FIND("(",A1&"("),FIND(")",A1&")")-(FIND("(",A1&"(")-1),"")) and that works fine.
I guessed the solution for Access would be newname:
TRIM(REPLACE([frhorse.NAME],FIND("(",[frhorse.NAME]&"("),FIND(")",[frhorse.NAME]&")")-(FIND("(",[frhorse.NAME]&"(")-1),""))
But this doesn't work as in returns undefined function "FIND" in expression error.
View 7 Replies
View Related
Mar 22, 2014
I have 4 fields that are unbound on a form. img1 img2 img3 img4..When these are entered they are all combined and autofill another unbound textbox = imagename.. what i would like to do is from this unbound textbox 'imagename' ..i would like to populate a textbox that IS bound called FileName
[Event Procedure]
Private Sub imagename_Click()
Me.imagename = Me.FileName
End Sub
View 4 Replies
View Related
Jul 24, 2015
We need to move rich text from an Access memo field to a Word text box. So far the best Ive been able to come up with is in the code below. In this code pprs!What is a record set field of a table memo field that is bound to a text box enabled for rich text. The rich text seems to be stored as html as so I can get word to convert it by enclosing it in html tags.
Dim What As Word.Shape
Set What = doc.Shapes.AddTextbox(msoTextOrientationHorizontal , doc.PageSetup.LeftMargin, 225, 534, 0)
Dim sPath As String
sPath = "G:Temp.html"
Open sPath For Output As 1
Print #1, "<HTML>" & pprs!What & " </HTML>"
Close #1
What.TextFrame.TextRange.InsertFile (sPath)
View 2 Replies
View Related
Jun 4, 2013
I have a single field in a table called "Client Contact", where users enter a semicolon between the name, address, and city state & zip. My reason for this was so we could copy client info with a single copy and paste (like from an email). But, on the final report, it needs to have these three parts split up into different lines, or even different textboxes. I can't find a way to do that.
View 1 Replies
View Related
Jul 12, 2013
I have a Form Display Data in my Access Database, which is working really well. However, users was asking if there is a way we can make Font Color Could/would change if The text in A field or Any field in my display form contained the word "SAD or MAD". Is there code for such thing in display form?..
View 3 Replies
View Related
Apr 15, 2014
I'm trying to pull a date from a table into a text box on a form tab control using DLookup and I just can't figure out what is wrong with my DLookup expression:
=DLookUp("DateOrdered","tDateOrdered","PrNumber=" & [PrNumber]) ----- (DateOrdered is short date, PrNumber is text, db is split Access 2013)
Whats missing in this expression? I've tried every criteria variant I could find but to no avail.
View 9 Replies
View Related
Mar 26, 2014
We have a database that we use to track the tablets in our organization, a combination of Apple, Android, and Windows.
We label them with a hostname depending on their branding. Example below.:
APPLE01
APPLE02
APPLE03
ANDROID01
ANDROID02
ANDROID03
WINDOWS01
WINDOWS02
In the database we use the field name HOSTNAME for these entries. When sorting the field, due to it being a text field, we get the traditional sort of
APPLE01
APPLE02
APPLE10
APPLE100
APPLE101
APPLE11
APPLE110
ANDROID01
ANDROID02
ANDROID10
ANDROID100
ANDROID101
ANDROID11
ANDROID110
We would like to have them show up as
APPLE01
APPLE02
APPLE10
APPLE11
APPLE100
APPLE101
APPLE110
ANDROID01
ANDROID02
ANDROID10
ANDROID11
ANDROID100
ANDROID101
ANDROID110
What is the best way to tackle this?
View 1 Replies
View Related
Jun 11, 2007
I am wondering if there is a way to automate the pasting function of text from one field into several others in a table without losing the data that is already in the field.
As an example: in 20 fields I have "I love potatoes" and I want to paste the text string, "And I love tomatoes too" in every field without overwriting the original text.
Thanks.
Steve
View 2 Replies
View Related
Feb 18, 2015
Produce a query that returns a yes or no (Y or N) field if other text field contains particular text (with wildcard on either side).
Idea is to have a column for each preset word.
View 2 Replies
View Related
Aug 8, 2013
I am trying to get information from webpage. [URL] ....
I am using the code:
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
ie.Navigate "http://benwerd.com/lab/geo.php"
While ie.Busy
DoEvents
Wend
Me.txtlat = ie.Document.getElementById("xxxxxxx")....
Here is the info I can't get from the page. Can't find the id or element that hold the information, latitude, longitude ... that is listed in the website.
View 5 Replies
View Related
Oct 8, 2014
I am trying to delete some text from a text field. There are almost 8000 records and almost all of them are like this.
Example: johnsmith-2.network.home.com
I want to delete everything after the dot and including the dot, to end up with "johnsmith-2". How do I do that? I think I can do it in a query, but don't remember how.
View 3 Replies
View Related
Oct 3, 2006
I need to convert my text data to a number but when I convert using the VALUE function or use "format cells" to the numbers category, I loose the leading zeros. I need to keep them for sorting purposes.
What formula do I use?
View 6 Replies
View Related
Nov 3, 2012
From a table I want a text field which has a path to a file to be copied automatically into a another field of the same table with a hyperlink text type...
View 5 Replies
View Related