Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Push value from lstbox to txtbox

Status
Not open for further replies.

Survane

MIS
Jul 3, 2002
74
US
This is my code:
Private Sub lstBox_AfterUpdate()
DoCmd.GoToControl "txtBox"
Me.txtBox.value = lstBox.value & vbCrLf & Me.txtBox.Text
End Sub

My lstbox and txtbox are bound to the same controlsource in the table.

When I select something from the listbox, it is erasing the textbox value and duplicating the selection text in the textboox.
Thanks.
 
Hi Survane,

Are you trying to populate a text box with the value that was selected in the list box? Not sure if I follow you here. It looks like you have a circular reference because the text property contains the current data in txtBox, but you assign it to a new value with the Value property. At that point, the data returned from the Text Property is the same as the Value Property. Is your text box high enough to display two rows? I would think that you would see the data selected in the list box on both rows. What are you trying to do? dz
dzaccess@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top