Get TextBox By Name - Access
-
I'm facing the following pbm. Question : I would to know the method to call the .value of textboxes/comboboxes by a String. Example : If InputLibelle.Value <> Me!SubStockEdit!DSLibelle.Value Then I want to compare the value of ItemName TextBox (Input + ItemName) and value of another Textbox in Subform Datasheet (SubStockEdit!DS + ItemName) multiple times. Code attempt : Dim TableColumnNames() As String TableColumnNames = Split("Poids, Dimension1, Dimension2, Dimension3, Description, Price", ",") For Each ColumnName In TableColumnNames If Me.Name("Input" & ColumnName).Value <> ??? Next Anyone have idea how to call these objects ?
-
Answer:
That would be: Dim TableColumnNames() As String TableColumnNames = Split("Poids, Dimension1, Dimension2, Dimension3, Description, Price", ",") For Each ColumnName In TableColumnNames If Me("Input" & ColumnName).Value <> Me!SubStockEdit("DS" & ColumnName).Value Then ' Do stuff. End If Next or perhaps this expanded syntax: If Me("Input" & ColumnName).Value <> Me!SubStockEdit.Form("DS" & ColumnName).Value Then
Falt4rm at Stack Overflow Visit the source
Other answers
Try one of this Controls("Input" & ColumnName).Name Controls("Input" & ColumnName).Value Me!SubStockEdit!Form.Controls("Input" & ColumnName).Value eval("Input" & ColumnName) eval("Me!SubStockEdit!DSLibelle")
Xilmiki
Related Q & A:
- How to get the Field Name,Field Length and Field Type?Best solution by Stack Overflow
- How to get the colour name by RGB value?Best solution by Stack Overflow
- How to get a host name?Best solution by Stack Overflow
- How could someone get your real name from yahoo when you have never used it in accounts or profiles?Best solution by Yahoo! Answers
- How can I get my real name off e-mails that I send?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.