Changing a qty in a listbox

G

George Lob

Let's say you are selling a widget. You have a list box that has available
widgets from different manufacturers and the qty in stock and you have a
list box of selected items. You select the widget that has the qty you need
in stock and you click a button to move it to the selected listbox. What I
want to do is adjust the qty of the widget in the available listbox to
reflect the available qty minus the selected qty.

The available listbox has a Select statement to fill the box.

I've tried:

Me.lstAvailable.Column(1) = Me.lstAvailable.Column(1) - Me.intQty

but I get a runtime error '424' Object required. Any help would be
appreciated.
 
B

Billy Yao [MSFT]

Hello George,

From your description, I learnt that you met with the 424 run-time error when you clicked a botton to move the
qty to a selected listbox. I'm not 100% sure of what happened on your side. Based on my experience, the
424 run-time error will occur if the control's Resize event is executed.

If you create a list box (or combo box) type of user control, the control's Resize event refers to the contained
list box (or combo box) incorrectly and this will causes the error 424, "Object required." In this scenario, you
can try to change the code in the user control's Resize event to refer correctly to the list box (or combo box)
contained in that user control.

On the other hand, if it cannot solve your problem, we need you to provide the SAMPLE database with the
neccessary objects only to reproduce the problem (You can remove the Confidential data or just create a
new repro database). In this way, we can look into the sample repro database and address the problem
quickly and efficiently. To send me the sample database, you can ZIP the .mdb and send it to (remove
"online." from this no Spam email address): mailto:[email protected]

If there is anything more I can do to assist you, please feel free to post it in the group.

Best regards,

Billy Yao
Microsoft Online Support
 
B

Billy Yao [MSFT]

Hi George,

Have you tried my suggestion to suppress the 424 run-time error? How are things going on your side currently?

I would appreciate it if you could post here to let me know the status of the issue. If the problem persists, could
you provide us with the SAMPLE databae to reproduce your issue, so that we can perform further analysis on
this problem. If you have any questions or concerns, please don't hesitate to let me know.

I look forward to hearing from you, and I am happy to be of assistance.

Thank you,

Billy Yao
Microsoft Online Support
 
G

George Lob

Thank you for your reply. I am not using the resize event at all, the code
is executed on click event. If I step through the code, all the numbers are
correct, but the error comes up as soon as the line is executed. I will try
to send you a sample today.
"Billy Yao [MSFT]" said:
Hello George,

From your description, I learnt that you met with the 424 run-time error
when you clicked a botton to move the
qty to a selected listbox. I'm not 100% sure of what happened on your
side. Based on my experience, the
424 run-time error will occur if the control's Resize event is executed.

If you create a list box (or combo box) type of user control, the
control's Resize event refers to the contained
list box (or combo box) incorrectly and this will causes the error 424,
"Object required." In this scenario, you
can try to change the code in the user control's Resize event to refer
correctly to the list box (or combo box)
contained in that user control.

On the other hand, if it cannot solve your problem, we need you to provide the SAMPLE database with the
neccessary objects only to reproduce the problem (You can remove the
Confidential data or just create a
new repro database). In this way, we can look into the sample repro
database and address the problem
 
B

Billy Yao [MSFT]

Hi George,

Thank you for your update and ongoing efforts!

I'm now waiting for your sample database, with which I can look deep into the issue. You can ZIP the sample
database and send it to (remove "online." from this no Spam email address):
mailto:[email protected]

Meanwhile, if there is anything I can do so assist you on this problem, please feel free to post it in the group.
We're happy to be of assistance.

Thank you,

Billy Yao
Microsoft Online Support
 
B

Billy Yao [MSFT]

Hi George,

I am currently standing by for an update from you and would like to know how things are going there.

Should you provide us with the sample database to reproduce the issue on your side, please don't hesitate to
let me know directly if there is anything I can do to assist you. It's my pleasure to be of assistance.

Regards,

Billy Yao
Microsoft Online Support
 

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

Top