Refer to second column in text box

  • Thread starter Thread starter Bradley C. Hammerstrom
  • Start date Start date
B

Bradley C. Hammerstrom

A2K

I want to display the current textbox value from one form in another form.
The textbox has a column count of 2 with column 1 hidden. What I want to
show in the other form is column 2.

Forms!frmForm1.txtDefect has column count 2; column 1 (Defect_ID) is hidden;
column 2 is Description and is displayed.

In the OnLoad event for frmForm2 I want to set a textbox to display whatever
Description is back on frmForm1. Like this:

Dim strDefect as String
strDefect = Forms!frmForm1.txtDefect (column = 2) [or something, to refer to
the second column]
Me.txtDefectChosen = strDefect

Brad H.
 
In the OnOpen event try:

Me.txtDefectChosen = Forms!frmForm1.txtDefect.column(1)

(The column index starts at 0 therefore "Column(1)" refers
to the second column of the list box).

Rgds,
Glenn
 
Back
Top