Removing Selected Text From A String
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 Replies
ADVERTISEMENT
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
Aug 28, 2015
I have an unbound listbox "Needs", and in the onclick event have the following code which works great if I have more than one item selected, but if I only have one item selected, it does not put it in the text box "ServiceText".
Code:
Private Sub Needs_BeforeUpdate(Cancel As Integer)
On Error GoTo errHandler
Dim ctl As Control
Dim strStart As String, strEnd As String
Dim aryList As String
Dim varSelected As Variant
[code]....
View 4 Replies
View Related
Aug 1, 2015
So, I have a main form with two continuous subforms like this:
frmContratos: main form
frmContInsumos: contains new products
frmInsumos: contains existing products
I want the user to highlight a word using a double click in a textbox called DescInsumo from frmContInsumos. And I want that highlighted portion to be used as filter for frmInsumos, which also has a textbox called DescInsumo. I used this and it's giving me the word, but it doesn't work with the double click event:
Code:
Private Sub DescInsumo_Click()
Debug.Print Me.DescInsumo.SelText
End Sub
View 4 Replies
View Related
Nov 29, 2005
I have a bunch of server names that have names like aaa.bbb, xxx.yyy. All i need from these server names is the name before the first "." so in the first example all I would need is aaa. I've been using this formula in excel MID(A1,1,FIND(".",A1) - 1). This works great.. Is there any way to do this in access?
View 1 Replies
View Related
Jan 5, 2005
is there a way to do this in VBA in Access I looked at trim but it does not help much
Dim MyString, TrimString
MyString = " <-Trim-> " ' Initialize string.
TrimString = LTrim(MyString) ' TrimString = "<-Trim-> ".
TrimString = RTrim(MyString) ' TrimString = " <-Trim->".
TrimString = LTrim(RTrim(MyString)) ' TrimString = "<-Trim->".
' Using the Trim function alone achieves the same result.
TrimString = Trim(MyString) ' TrimString = "<-Trim->".
I have a select statment setting the data that will be in a combo box
I would like to trim this data...
for example the select statment returns something like
category>subcatgory>field>subfield
so I want to trim it down to be
field>subfield
View 3 Replies
View Related
Jun 19, 2015
I would like to remove the comma, but only one that is at the end of my string(there is a space after the comma, should be also removed).How should I do that in vba?
View 2 Replies
View Related
Feb 7, 2014
I am using this code
DoCmd.OutputTo acOutputReport, "rptFilter", "Excel97-Excel2003Workbook(*.xls)", strFilename, True, "", , acExportQualityScreen
With the OutputFile set to "" so the user can select the directory on where they want to store the exported template. I'm trying to figure out if I could get the file path and the file name and store it on a string so I could use it for something else.
View 4 Replies
View Related
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
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 5 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
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
Dec 21, 2012
I have a form where I want a textbox [txtMaxOrdLimit] to be visible only if another text box on the same form [PaNumber] contains the letter D in the string. This is the code I have on the forms On Current property but I'm missing something because textbox [txtMaxOrdLimit] doesn't show on the form at all.
If Me.PaNumber = "*D" Then
Me.txtMaxOrdLimit.Visible = True
Else
Me.txtMaxOrdLimit.Visible = False
End If
View 3 Replies
View Related
Apr 21, 2005
Ok I have a db that list stats for many of NFL's Great players. I have created a form with a drop down combobox that list the players. The rest of the form displays the stats for that player. I have linked two forms with a command button. I was hoping that I could use another command button in combination with a macro that would allow me to send (just the displayed record) to a text file. I have tried using a macro with OutPut To but it sends the entire table to text.....Please Help Me I have been working on this for Two DAYS...... :eek: HELP!!!!
View 1 Replies
View Related
Feb 12, 2006
Dear All
I have a form with memo field as [acLetter]. Now whenever I open the form the text in the memo forms are all selected/highlighted in all the records. Is there any settings required to disable this feature or have I missed out something, so that the text should not be selected at the time of opening the form.
Thanks
View 1 Replies
View Related
Dec 4, 2006
I have two forms - Notes and JobLookup
Notes contains a number of text boxes for entering data, one of them being for Job No. Beside it is a link to the form JobLookup. This form contains a simple listbox that lists all the job no. Is it possible to pass the selected job no from this list to the text box on the Notes form?
Hope this makes sense :)
Michael
View 3 Replies
View Related
Aug 5, 2011
I basically need a text box which is for date/time to disapear/appear when i tick or untick a little tick box.
My tick box is called AlarmResponse and my text box is called CallReceived...
View 14 Replies
View Related
Oct 25, 2006
Hey Guys,
I've got a field called [WordLink] on a form where the user enters the file name of the Word or Excel document asociated with the record.
I have a button that opens Word or Excel and then opens the file...not a problem there as I'm using the Call Shell("""C:Program Files command and that works just fine.
However, I need the button to look to see if it's got ".doc" or ".xls" within the text string in the field so it knows whether to open Word or Excel.
I've tried something basic to launch something like a msgbox (see code below) but obviously it doesn't work. How do I look within a text string for a value?
Cheers,
Russ
:D
If Me.WordLink_filename.Value = "*.doc" Then
MsgBox "This is a word file."
Else
End If
View 2 Replies
View Related
Feb 7, 2005
What is the VBA code for this:
VariableName = Select Table1.Field2 From Table1 Where Table1.Field1 = "TextValue"
I would like to set the VariableName to the value of field2 where field1 is equal to a text string.
Thank you for taking the time to review and answer this for me.
Marty
View 5 Replies
View Related
Apr 25, 2006
I have created a report that has string text from a query I created. The query, with the string text, take the information from a table. When I run the report the string text gets cut off (The box is big enough to hold the information). The table I have is a linked table to a text file that gets imported from a program. I try creating the same table but not having it linked and the string text worked.
Is there some way I can get around this? Is there something in the linked table that is stoping the string text?
View 14 Replies
View Related
Sep 21, 2005
Access 2000. I have table of many hundreds of records. One of th fields of text looks like this: XXXXXXXXXXXX and I want it to look like this: XXX XXX XXX XXX by adding the spaces. Would someone please show me how to write the function or code to add the spaces to the text as shown : Thanks :o
View 3 Replies
View Related
Aug 7, 2005
First of all I'm not very good with VB. What I'm trying to do is get all my customers email addresses in one text string. So it would go like 123@aol.com; bob@yahoo.com; fred@hotmail.com; and etc. My customer could then copy it and paste it in her TO: box of her email server. Any help would be great.
View 6 Replies
View Related
Aug 21, 2014
I have a text field with receipt numbers in the format 0001-00000### and I would like my data entry form to default the max existing value + 1.
If max value is 0001-00000201, then the new record should suggest 0001-00000202.
The problem is that if I use the "max" function, it does not work (I think because that function is intended for numbers, not text strings).
Table: RECEIPTS
Field: receiptnum
I also have a query with just one field that lists only the receiptnum unique values so that I can use them in comboboxes in other forms... it may be useful I guess...
Query: unique-receiptnum
Field name: receiptnum
View 4 Replies
View Related
May 5, 2005
:) Hello
Is it possible to change the colour of the text in a table. For example the word "URGENT" is selected from a combo box, and when viewed in the table it appears red.
Thanks inancipiation
Woozie
View 1 Replies
View Related
Aug 8, 2014
We have a navigation page with 5 tabs and several navigation buttons underneath their respective tabs linking to reports.
In the main part of the navigation page we have 17 search parameters (text boxes and combo boxes)that the user can use to sort through all the reports we have in the different tabs.
What we would like to do is to have the label text to change to "red" if one of the 17 fields are "required", remain "black" if it is included in the report but not a mandatory search parameter, or turn "light grey" if that parameter is not included in that report.
For example:
My search parameters are: people, phone, and cars
If I were looking at a report of people that included addresses, phones, etc...name and phone would be required search parameters. However, even though I can search by car, it is not in this particular report and the label text should be greyed out. (If the actual text box could go inactive that would be even better).
I have read about buttons being turned colors based on a drop down box choice, but I have not been able to find anything about using a navigation tab subform button to make the colors change in the main navigation form.
View 14 Replies
View Related
Sep 10, 2014
Is it possible to have a query that will requery value of a check box based on which check box is selected? I have a form that has 5 check boxes and a text field for populating a unit price. When someone clicks a specific check box, the text field should display the unit price. I know how to accomplish this using a combo box and don't want to change the form to setup for a combo box, but rather use what everyone is currently used to. I want to add the check box is from 1 table linked to a form and the unit price is from another table not linked to a form. Both tables have 2 fields in each that will relate.
View 6 Replies
View Related