Trying to update a field

D

DT

I have a form that has a combo box that a user can select a part number from.
There is also a text area that they can enter in the quanity that they would
like to add or delete from inventory. When they click on submit it runs a
query.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14];

Nothing updates when I have the query like this. If I limit the where to
one record. It works fine. But I would like the query to find the current
selected PartNum from the combo box. Thanks for the help
 
C

Christopher Robin

I'm not sure, I understand your intent. Are you attempting to add multiple
items to a queue and then update their respective inventory levels en masse?
Personally, I believe that your form is working as it should, in that it only
updates the current record selected. If you are allowing the user to select
an item, update its inventory level, add that to a queue and then continue to
add other level adjustments, then the code for your submit button would have
to reference the controls in your sub-form/queue (however you're storing that
data).

HTH, and that I haven't completely confused you.
 
D

DT

No, I am not trying to update multiple items. All I am trying to do is
create a form that a user can select a part number from a dropdown list, add
then the quanity they want, and hit submit. Then it should update the part
numbers level to the new quanity. The way the code is right now, nothing is
getting updated. If I change the WHERE statement to search for a specific
part number i.e.

WHERE Inventory.PartNum="12345"

Then it works fine. Does this make sense what I am trying to do? Thanks
again for the help.



Christopher Robin said:
I'm not sure, I understand your intent. Are you attempting to add multiple
items to a queue and then update their respective inventory levels en masse?
Personally, I believe that your form is working as it should, in that it only
updates the current record selected. If you are allowing the user to select
an item, update its inventory level, add that to a queue and then continue to
add other level adjustments, then the code for your submit button would have
to reference the controls in your sub-form/queue (however you're storing that
data).

HTH, and that I haven't completely confused you.

DT said:
I have a form that has a combo box that a user can select a part number from.
There is also a text area that they can enter in the quanity that they would
like to add or delete from inventory. When they click on submit it runs a
query.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14];

Nothing updates when I have the query like this. If I limit the where to
one record. It works fine. But I would like the query to find the current
selected PartNum from the combo box. Thanks for the help
 
C

Christopher Robin

So, Combo14 is the combo box, but which column is the PartNum?

WHERE Inventory.PartNum = Me.combo14.Column(0)

DT said:
No, I am not trying to update multiple items. All I am trying to do is
create a form that a user can select a part number from a dropdown list, add
then the quanity they want, and hit submit. Then it should update the part
numbers level to the new quanity. The way the code is right now, nothing is
getting updated. If I change the WHERE statement to search for a specific
part number i.e.

WHERE Inventory.PartNum="12345"

Then it works fine. Does this make sense what I am trying to do? Thanks
again for the help.



Christopher Robin said:
I'm not sure, I understand your intent. Are you attempting to add multiple
items to a queue and then update their respective inventory levels en masse?
Personally, I believe that your form is working as it should, in that it only
updates the current record selected. If you are allowing the user to select
an item, update its inventory level, add that to a queue and then continue to
add other level adjustments, then the code for your submit button would have
to reference the controls in your sub-form/queue (however you're storing that
data).

HTH, and that I haven't completely confused you.

DT said:
I have a form that has a combo box that a user can select a part number from.
There is also a text area that they can enter in the quanity that they would
like to add or delete from inventory. When they click on submit it runs a
query.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14];

Nothing updates when I have the query like this. If I limit the where to
one record. It works fine. But I would like the query to find the current
selected PartNum from the combo box. Thanks for the help
 
D

DT

PartNum is the third column. 0 being ID, 1 being PartDesc, and 2 being
PartNum. Here is my code but it still isn't updating the Level Field.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14]![column(2)];

Thanks again

Christopher Robin said:
So, Combo14 is the combo box, but which column is the PartNum?

WHERE Inventory.PartNum = Me.combo14.Column(0)

DT said:
No, I am not trying to update multiple items. All I am trying to do is
create a form that a user can select a part number from a dropdown list, add
then the quanity they want, and hit submit. Then it should update the part
numbers level to the new quanity. The way the code is right now, nothing is
getting updated. If I change the WHERE statement to search for a specific
part number i.e.

WHERE Inventory.PartNum="12345"

Then it works fine. Does this make sense what I am trying to do? Thanks
again for the help.



Christopher Robin said:
I'm not sure, I understand your intent. Are you attempting to add multiple
items to a queue and then update their respective inventory levels en masse?
Personally, I believe that your form is working as it should, in that it only
updates the current record selected. If you are allowing the user to select
an item, update its inventory level, add that to a queue and then continue to
add other level adjustments, then the code for your submit button would have
to reference the controls in your sub-form/queue (however you're storing that
data).

HTH, and that I haven't completely confused you.

:

I have a form that has a combo box that a user can select a part number from.
There is also a text area that they can enter in the quanity that they would
like to add or delete from inventory. When they click on submit it runs a
query.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14];

Nothing updates when I have the query like this. If I limit the where to
one record. It works fine. But I would like the query to find the current
selected PartNum from the combo box. Thanks for the help
 
C

Christopher Robin

One way of solving this, is to add the Level control to your form, but make
it invisible, and then, when the button is clicked, simply do:

Me.Level = Me.Level + Me.Combo14.Column(2)

Do you get any error messages from your query? Or does it simply state that
0 records were updated?

DT said:
PartNum is the third column. 0 being ID, 1 being PartDesc, and 2 being
PartNum. Here is my code but it still isn't updating the Level Field.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14]![column(2)];

Thanks again

Christopher Robin said:
So, Combo14 is the combo box, but which column is the PartNum?

WHERE Inventory.PartNum = Me.combo14.Column(0)

DT said:
No, I am not trying to update multiple items. All I am trying to do is
create a form that a user can select a part number from a dropdown list, add
then the quanity they want, and hit submit. Then it should update the part
numbers level to the new quanity. The way the code is right now, nothing is
getting updated. If I change the WHERE statement to search for a specific
part number i.e.

WHERE Inventory.PartNum="12345"

Then it works fine. Does this make sense what I am trying to do? Thanks
again for the help.



:

I'm not sure, I understand your intent. Are you attempting to add multiple
items to a queue and then update their respective inventory levels en masse?
Personally, I believe that your form is working as it should, in that it only
updates the current record selected. If you are allowing the user to select
an item, update its inventory level, add that to a queue and then continue to
add other level adjustments, then the code for your submit button would have
to reference the controls in your sub-form/queue (however you're storing that
data).

HTH, and that I haven't completely confused you.

:

I have a form that has a combo box that a user can select a part number from.
There is also a text area that they can enter in the quanity that they would
like to add or delete from inventory. When they click on submit it runs a
query.

UPDATE Inventory SET Inventory.[Level] =
[Level]+[Forms]![frmInventoryAddDelete]![text10]
WHERE Inventory.PartNum=[Forms]![frmInventoryAddDelete]![combo14];

Nothing updates when I have the query like this. If I limit the where to
one record. It works fine. But I would like the query to find the current
selected PartNum from the combo box. Thanks for the help
 

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