Pull data into unbound txt box

ppoindexter

Registered User.
Local time
Yesterday, 22:55
Joined
Dec 28, 2000
Messages
134
I have an unbound text box that i want to pull data into by selecting a record in a combo (the combo has the following code),


Private Sub Combo_tplan_GotFocus()
If IsNull(Me.Combo_standard) = True Then
Me.Combo_tplan.RowSource = "select fldtplanid,fldtplan_brief_description from tblmimtplan where fldmim_core_id= " & Me.Combo_Component & " And fldlevel2id = " & Me.Combo_Grade & " order by fldtplan_brief_description"
Else
Me.Combo_tplan.RowSource = "select fldtplanid,fldtplan_brief_description from tblmimtplan where fldmim_core_id= " & Me.Combo_Component & " and fldlevel1id= " & Me.Combo_standard & " And fldlevel2id = " & Me.Combo_Grade & " order by fldtplan_brief_description"

End If
End Sub


i tried using the pull method for an unbound text box
=Combo_tplan.Column(2)
but the code that populates the combo prevents the pull code from working...(at least i am assuming this as i usually have no problem with this method)

i have tried at length to use the following

Me![Text_Label] = Me![Combo_tplan].Column(2)

within the "got focus" code from the combo but have had no luck

any help would be appreciated
 
You only have two columns in your Combo_tplan combo box. The .Column property index begins at 0 for column 1. Try using
Me![Text_Label] = Me![Combo_tplan].Column(1)
to retrieve the contents of column 2 into the Text_Label control.
 
i have tried using a different column number...i think the problem has to be in the Combo_tplan_GotFocus code...that seems to be the record source for the text_label..no matter what i do to the row source query.....

for instance

the "Combo_tplan_GotFocus" code pulls the field fldtplan_brief_description data in the column (1) location and that is what populates the combo_tplan (as it should be) AND it also populates text_label when i use =[Combo_tplan].[Column](1)

i see the exact same record in both the text box and the combo box...i need to add "something" to the "Combo_tplan_GotFocus"....that pulls fld_label into text_label......

thanks for you help
 
i got it...finally...

just needed to add one field

(fldtplan_label)

to the "Combo_tplan On GotFocus" event ...ie... "select fldtplanid, fldtplan_brief_descritpion, fldtplan_label from tblmimtplan......

and in the control Text_Label i added

=[Combo_brief].[Column](2)

the entire code as follows:

Private Sub Combo_tplan_GotFocus()
If IsNull(Me.Combo_standard) = True Then
Me.Combo_tplan.RowSource = "select fldtplanid,fldtplan_brief_description,fldtplan_label from tblmimtplan where fld_resource_added=0 and fldmim_core_id = " & Me.Combo_Component & " And fldlevel2id = " & Me.Combo_Grade & " order by fldtplan_brief_description"
Else
Me.Combo_tplan.RowSource = "select fldtplanid,fldtplan_brief_description,fldtplan_label from tblmimtplan where fld_resource_added=0 and fldmim_core_id= " & Me.Combo_Component & " and fldlevel1id= " & Me.Combo_standard & " And fldlevel2id = " & Me.Combo_Grade & " order by fldtplan_brief_description"

End If
End Sub

as always, thanks for the replies
 

Users who are viewing this thread

Back
Top Bottom