By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Update txtbox with value from listbox

P: n/a
Hi,

I have three objects in my form:

a listbox (lstform)
a subform (fsub)
a txtbox (txt)

The listbox lists form names that will be displayed in the subform. To do
this I use the following line in the afterupdate event of the listbox:

Me.fsub.SourceObject = Me.lstform.Column(1)

This works ok.

Now, I have another column (hidden in the listbox) that I want to display
in the txtbox (txt). It is just some text explaning what form is displayed
in the subform.

Question is, how to do this.

I've tried to set in the Control Source of txt the following:

=Me.lstform.column(1)

It's not working, what should I do?

Thanks,

Koen
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You're almost there. Remember that columns are zero-based, so
the first column in the query is Me.lstForm(0) and the last one is
Me.lstForm(n-1)

Now, for this to work, you need to set the column count property
for the listbox to the full number of columns desired. Make sure
this property is set correctly.

--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"Koen" <no@spam.nl> wrote ...
Hi,

I have three objects in my form:

a listbox (lstform)
a subform (fsub)
a txtbox (txt)

The listbox lists form names that will be displayed in the subform. To do
this I use the following line in the afterupdate event of the listbox:

Me.fsub.SourceObject = Me.lstform.Column(1)

This works ok.

Now, I have another column (hidden in the listbox) that I want to display
in the txtbox (txt). It is just some text explaning what form is displayed
in the subform.

Question is, how to do this.

I've tried to set in the Control Source of txt the following:

=Me.lstform.column(1)

It's not working, what should I do?

Thanks,

Koen

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.