How to get textbox by name?

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

Was this solution helpful to you?

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:

Just Added Q & A:

Find solution

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.