Combo Box and List Box

M

Majic

I created a database with list boxes and combo boxes. I know there is
a limit of 325 row in combo box and list box. I have 30000 items in
the list and I want to be able to have it in combo box or list box.
I could see all the items, but when I select beyond 255 it defaults to
a different number.

Do you know any code that will fix this problem?

Thank you

Majic
 
R

Rick Brandt

Majic said:
I created a database with list boxes and combo boxes. I know there is
a limit of 325 row in combo box and list box. I have 30000 items in
the list and I want to be able to have it in combo box or list box.
I could see all the items, but when I select beyond 255 it defaults to
a different number.

Do you know any code that will fix this problem?

Something else is wrong. There is no 325 row limit on either ListBoxes or
ComboBoxes. There are many developers who believe it foolish to have more
than a few hundred rows in either type of control, but there is nothing that
stops you from doing it and once having done it they should still function
as expected (though they could be slow due to the number or rows).
 
M

Majic

Something else is wrong. There is no 325 row limit on either ListBoxes or
ComboBoxes. There are many developers who believe it foolish to have more
than a few hundred rows in either type of control, but there is nothing that
stops you from doing it and once having done it they should still function
as expected (though they could be slow due to the number or rows).

Rick,
Thank you for replying so quickly and I meant 225 not 325.
You are right, it works just fine. The way I have it setup is when
you select a partnumber, the price will display in the second field.
When I did that, then the list will not work properly.
I know I am doing something wrong, but do not know what. Could you
direct me what to do?
I need to select part number from list and price to display associated
with that item and the description if all possible.

Thank you

Majic
 
R

Rick Brandt

Majic said:
Rick,
Thank you for replying so quickly and I meant 225 not 325.
You are right, it works just fine. The way I have it setup is when
you select a partnumber, the price will display in the second field.
When I did that, then the list will not work properly.
I know I am doing something wrong, but do not know what. Could you
direct me what to do?
I need to select part number from list and price to display associated
with that item and the description if all possible.

What are you doing now? You should be able to include the price and
description as additional columns in the ListBox or ComboBox and then grab
them from there in the AfterUpdate event of the ListBox or ComboBox.
Although I would argue that you should only *display* the description and
not copy it. Only the price should need to be copied.
 
M

Majic

What are you doing now? You should be able to include the price and
description as additional columns in the ListBox or ComboBox and then grab
them from there in the AfterUpdate event of the ListBox or ComboBox.
Although I would argue that you should only *display* the description and
not copy it. Only the price should need to be copied.

Rick,
Here is what I have setup:
I have a table called products that has Part Number, Description and
Price. Then, I have a form and subform. The subform that has the
item, Qty, part number (list box), Description (list Box), Price,
total cost. Currently, I select Part Number from the list box and it
displays the price by using afterupdate event. When I did that then
it will limit my partnumber list and will not work properly. Here is
what I used for my afterupdate statements:

Private Sub cboUnitCostSelect_AfterUpdate()
Me!cboUnitCostSelect.Requery
Me!cboUnitCostSelect.SetFocus
End Sub

Private Sub Form_Current()
Me!cboUnitCostSelect.Requery
End Sub

Please advise of what I am doing wrong.

Thank you
Majic
 
R

Rick Brandt

Majic said:
Rick,
Here is what I have setup:
I have a table called products that has Part Number, Description and
Price. Then, I have a form and subform. The subform that has the
item, Qty, part number (list box), Description (list Box), Price,
total cost. Currently, I select Part Number from the list box and it
displays the price by using afterupdate event. When I did that then
it will limit my partnumber list and will not work properly. Here is
what I used for my afterupdate statements:

I don't understand that. The only way AfterUpdate code will do anything to
the list in your ComboBox is if it is actually changing the RowSource
property or altering the table/query being used by the ComboBox's RowSource.

Private Sub cboUnitCostSelect_AfterUpdate()
Me!cboUnitCostSelect.Requery
Me!cboUnitCostSelect.SetFocus
End Sub

Private Sub Form_Current()
Me!cboUnitCostSelect.Requery
End Sub

Please advise of what I am doing wrong.

What do you expect to happen with a Requery or a SetFocus? There is nothing
in that code that will do anything to copy the Price. Normally I would
expect code similar to...

Private Sub cboUnitCostSelect_AfterUpdate()
Me!Price = Me.boUnitCostSelect.Column(1)
Me!Description = Me.boUnitCostSelect.Column(2)
End Sub
 
M

Majic

I don't understand that. The only way AfterUpdate code will do anything to
the list in your ComboBox is if it is actually changing the RowSource
property or altering the table/query being used by the ComboBox's RowSource.




What do you expect to happen with a Requery or a SetFocus? There is nothing
in that code that will do anything to copy the Price. Normally I would
expect code similar to...

Private Sub cboUnitCostSelect_AfterUpdate()
Me!Price = Me.boUnitCostSelect.Column(1)
Me!Description = Me.boUnitCostSelect.Column(2)
End Sub

Thank you so much. I am going to try that and see what happens

Majic
 
M

Majic

I don't understand that. The only way AfterUpdate code will do anything to
the list in your ComboBox is if it is actually changing the RowSource
property or altering the table/query being used by the ComboBox's RowSource.




What do you expect to happen with a Requery or a SetFocus? There is nothing
in that code that will do anything to copy the Price. Normally I would
expect code similar to...

Private Sub cboUnitCostSelect_AfterUpdate()
Me!Price = Me.boUnitCostSelect.Column(1)
Me!Description = Me.boUnitCostSelect.Column(2)
End Sub

Rick,
What is the column referring to Column in Products table where the
column that is placed in? It is not working at all, I tried both
ways.

Thank you
 
R

Rick Brandt

Majic said:
Rick,
What is the column referring to Column in Products table where the
column that is placed in? It is not working at all, I tried both
ways.

Those are additional columns that you add to the ListBox or ComboBox. If
you don't want to see them set their width to zero. The first column is
Column(0).
 
M

Majic

Those are additional columns that you add to the ListBox or ComboBox. If
you don't want to see them set their width to zero. The first column is
Column(0).

Thank you

Majic
 

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


Top