combo box questions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box and i've got most of what i need for it all firgured out
but i have two questions and any help with them would be greatly appreciated.

1) i know to get the first value is [Combo19].[ItemData](0) is there
something i could put in place of zero to get to the last item (other then
the actual index to the item)?

2) is there a setting or code i could use to prevent the user to be able to
type in the combo box locking and\or disabling don't work beccause then i
can't select things.
 
I have a combo box and i've got most of what i need for it all firgured out
but i have two questions and any help with them would be greatly appreciated.

1) i know to get the first value is [Combo19].[ItemData](0) is there
something i could put in place of zero to get to the last item (other then
the actual index to the item)?

Why would you WANT to do so? What's the rowsource; or is it variable?

You could do it in code, I suspect (though I haven't tried it):

[Combo19].[Itemdata].Column([Combo19].ColumnCount - 1)

but I'm not sure I understand the scenario that would make this
useful!
2) is there a setting or code i could use to prevent the user to be able to
type in the combo box locking and\or disabling don't work beccause then i
can't select things.

Set its Limit to List property to True.

John W. Vinson[MVP]
 
well if you want to know i need the last entry because that is the latest one
entered. when a subform that enters a new record closes i want the combo box
to display that record so other data can be entered without having to select
it. your suggestion should work i just have to fiddle with it i think.

as for seting limit to list to true it is already set to yes. any other
suggestions?

John Vinson said:
I have a combo box and i've got most of what i need for it all firgured out
but i have two questions and any help with them would be greatly appreciated.

1) i know to get the first value is [Combo19].[ItemData](0) is there
something i could put in place of zero to get to the last item (other then
the actual index to the item)?

Why would you WANT to do so? What's the rowsource; or is it variable?

You could do it in code, I suspect (though I haven't tried it):

[Combo19].[Itemdata].Column([Combo19].ColumnCount - 1)

but I'm not sure I understand the scenario that would make this
useful!
2) is there a setting or code i could use to prevent the user to be able to
type in the combo box locking and\or disabling don't work beccause then i
can't select things.

Set its Limit to List property to True.

John W. Vinson[MVP]
 
Try using the KeyPress Event of the ComboBox and set the KeyAscii to 0.

Check Access VB Help on the KeyPress Event.
 
well if you want to know i need the last entry because that is the latest one
entered. when a subform that enters a new record closes i want the combo box
to display that record so other data can be entered without having to select
it. your suggestion should work i just have to fiddle with it i think.

You were asking (I thought) for the last COLUMN in the combo box. Now
I see you want the value of the table field to which this combo box is
bound from the most recently entered record - a totally different
issue.

I think you may be misunderstanding the function of a combo box. It
doesn't display "a record". It allows you to select ONE field from a
query or list of values (its "Row Source") and (optionally) store that
one value into a single field of some other table (its "Control
Source").

How are *you* using the combo box? What specifically are you trying to
accomplish with it?

John W. Vinson[MVP]
 
That means you use the KeyDown Event which is fine also..

KeyAscii is used with the KeyPress Event so my advice was correct.
 
I know how the combo box works it looks up one field in the record and then
the rest of the fields are displayed in other text boxes when a selection is
made. a new record can be created by clicking a button and this will open a
subform where a user can enter data that goes into the combo box. upon return
from the subform i would like it to display what the user entered so he\she
can enter data for the rest of the fields.
 
I know how the combo box works it looks up one field in the record and then
the rest of the fields are displayed in other text boxes when a selection is
made. a new record can be created by clicking a button and this will open a
subform where a user can enter data that goes into the combo box. upon return
from the subform i would like it to display what the user entered so he\she
can enter data for the rest of the fields.

This is a VERY unusual way to use a combo box. Are you trying to store
the looked-up fields from the combo into a table other than the
combo's row source? What are the Recordsources of the form and
subform, the Row Source of the combo, and the fields displayed from
the combo?

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Can't select any from Combo Box 4
Combo box default 7
problem with mulit-column value list combo box 2
combo box locked 4
Combo Box Question 4
Combo Boxes 11
Combo box questions 2
Cascading Dependant combo boxes 0

Back
Top