Forms :: Get Selected Text From Textbox As Filtering String For Another
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
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.
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
i have employee form to insert employee information one of its text box on click another form open of schools name where i can select the school work how can i pass selected school name to the main form
I have an Access 2010 database where we have a SQL Linked Table with a column that is nVARCHAR(20) Not Null data type. We have created a form for data entry. Currently when the user tries to erase a value or choose not to define a value we get the following error.
"You tried to assign the Null value to a variable that is not a Variant data type."
This field should accept a blank value "" as the user may not want to set the value. We do not have control over the DB schema, so how can I work around this issue in access?
I am building a form in access and I am trying to find a way where user input isn't possible in the associated textbox when "No" from on option box is selected.
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.
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...
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.
1) How to auto fill in a text box if you select a value from the last of 4 cascade comboboxes.
I have 4 comboboxes where
1 = Apparaat - cboApparaat 2 = Type - cboType 3 = OS - cboOS 4 = Probleem - cboProbleem
With all 4 comboboxes I have the vba code Me.cbo[name combobox].Requery
If I select the last combobox, cboProbeem. I want the textbox underneath to automaticly fill in the solution of that problem. I already tried to use the following vba code
Me.Oplossing = Me.cboProbleem.Column(5)
But it does not work.
2) I want to make a form for customers, where I can fill in customer info, device info and date when there contract started. Now I want to use SUM to fill in the end date of there contract.
I have a textbox on a form that i am pulling off of a table. the table stores the infor as listed below
customer ordernumber order description
Jeff 123 -abc -def -ghi Bill 456 -ghy -hig
but when i bring the field into a form it lists it out the field of order description as below in a textbox, i used textbox b/c the the text can be pretty long
-abc-def-ghi
how can i make it so that it separates out the listing as i have it on the table?
I have tried to find this on the forum but it seems all the answers are to do with manipulating the strings based on what the postcode is whereas I just want to extract the postcode as a separate string as simply as possible.
Basically, I have a text field called Add5 which has the last line of the address including the postcode.
Example: "Northampton NN1 7PQ"
I am trying to end up with two strings like this
Add5 = "Northampton" Postcode = "NN1 7PQ"
I only need to do this in one place, I don't think it needs a module.
Is there an efficient way to have default text in a textbox on my form (like a search box), but have it so that when a user focuses on the textbox (to type in a search term), the word should disappear.
Just like the search box on windows 7 start menu.
Then, is there a way to have the default text not be the actual text in the box? Otherwise, my search box will search the default text.
This really is more of a VB than an Access question, but I need it answered, and I don't know a good VB forum so....
I have a text box that I'm trying to add text to, I have a loop, and every time through the loop it's supposed to concatenate new text into the text box by appending it to the end. I can't seem to be able to find a way to do this. I can't use the <&> operator, and VB doesn't have a <+=> operator (I wish I could do this in C/C++, but oh well). Any ideas? Or do I have to set the existing text to a string, concatenate the new text onto that, and then set it to the textbox?
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.
I have a textbox on a subform and I want to get the sum in a string as follows.
Code: Dim s1 As String s1 = Sum(Forms!CountItem!CountItemLastCount.Form!ThisCount) MsgBox s1
When I use the above I get an error message saying - Sub or function not defined and it highlights the sum part of the equation.
I have been using the sum criteria in a textbox but if the user doesn't tab of the box then it doesn't see it as being updated.
I have tried me.dirty and everything else that usually works like send keys tab event, requery form and controls, a left mouse click but nothing is working, therefore I thought that code to actually update the textbox may work.
I have a two-column list box where the user selects multiple Test Names and Test Measures. Through VBA, I loop through and create a string of the selected items and store into two seperate variables, one for each column. I concatenate with the "In" and some parenthesis to end up with the following:
I place each of the In statements into two seperate dummy text boxes on the form. Then I point the query criteria to these text boxes.
When I run the query, I get nothing. However, if I copy and paste the In statements above from the text boxes directly into the query criteria, I get the desired results.
I changed the code to create an "Or" statement (e.g. "ELA" OR "MEAP" OR "Star Math"), but still the same issue.
why the query will not read from the text boxes on the Form?
I have an unbound form (named frmReportSearch) with unbound text & combo boxes providing the criteria for a query (named qSeqStreets). The form / query utilize 4 optional fields as search criteria plus date from / to. The results are returned via a report (named rptSeqStreets). The whole operation worked perfectly, however I realized I needed to change one of the criterion to a multivalued field. The change in the table (named Tasks) worked perfectly. I used three checkboxes (named chkA, chkB and chkC) to allow the user to select any combination of the 3 choices, including none (to be treated as no filter on [fldShifts]).
The three options in the field (named fldShifts) are "A" "B" and "C". I am able to manually run the query from design view by typing in the criteria "A" Or "B"... "A" Or "B" Or "C"... and any combination of the three options in the criteria box and running the query. I am using the following code under the OK button's OnClick. The Code below has other items related to all the options .... I didn't want to give partial code so you may understand better:
Code: Private Sub btnOK_Click() Dim strShift As String Dim strA As String Dim strB As String Dim strC As String
[Code] .....
My problem is that the query criteria needs to be entered into the criteria box with quotes and separated by "Or" depending on if multiple checkboxes are selected.
I can get the results to show correctly in the textbox, however I imagine the query is adding an extra set of ""s to the string so rather than "A" Or "B" .. it is getting ""A" Or "B"". My query Sql and even design mode are pretty complex, so I wouldn't know how to use the sql in VBA without blowing some fuses.
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