After Update Puzzle

M

Michael Firey

I use the "After Update" code below and am having a puzzling problem.
With certain "Item Codes", it doesn't update. I'm trying to figure
out why.

Example "Itemcodes" that do work:
"Barrister"
"NotebookLabor"

Example "ItemCodes" that do not work:
"Rhombus"
"LaptopLabor"

Here is the code I'm using:

Private Sub ItemCode_AfterUpdate()
Me.ItemCode.Requery
Me.Price = Me.ItemCode.Column(1)
Me.ItemDescription = Me.ItemCode.Column(2)
Me.ItemType = Me.ItemCode.Column(3)
End Sub
 
M

Michael

Further details.....

I just discovered that any "ItemCode" that starts with a "R" or a "L"
doesn't update. I can take a non-working code like Rhombus or
Laptoplabor and add a "Z" to it and it then works (zRhombus &
zLaptoplabor for example). Any idea why it doesn't work?
 
J

John W. Vinson

Further details.....

I just discovered that any "ItemCode" that starts with a "R" or a "L"
doesn't update. I can take a non-working code like Rhombus or
Laptoplabor and add a "Z" to it and it then works (zRhombus &
zLaptoplabor for example). Any idea why it doesn't work?

Nope. You have not posted enough information about the underlying structures
for anyone to be able to help.

We'll be glad to help but we need something to work with.
 
M

Michael

More details:

tables involved: Tickets, AccountsReceivables, & ItemCodes.

I use a ticket form with a subform showing account receivables for the
ticket. I use an itemcode field in the accounts receivable subform
with a drop down combo box called itemcode which pulls the item code
from the itemcodes table. There is an "after update" on that field
that uses the code above to auto fill the fields "price",
"itemdescription", and "itemtype". When I use any item code that
starts with a R or a L, the after update does not work. If I use an
item code that starts with letters like Z, B, or N it works. Doesn't
make any sense.
 
J

John W. Vinson

More details:

tables involved: Tickets, AccountsReceivables, & ItemCodes.

I use a ticket form with a subform showing account receivables for the
ticket. I use an itemcode field in the accounts receivable subform
with a drop down combo box called itemcode which pulls the item code
from the itemcodes table. There is an "after update" on that field
that uses the code above to auto fill the fields "price",
"itemdescription", and "itemtype". When I use any item code that
starts with a R or a L, the after update does not work. If I use an
item code that starts with letters like Z, B, or N it works. Doesn't
make any sense.

A post of mine seems to have gotten lost.

Please post the SQL view of the combo box's RowSource query, and open that
query in datasheet view and report a few of the records (particularly those
that start with R). Also indicate the combo box's Control Source and Bound
Column.

The one thing that makes me suspicious is the Requery line - it should not be
necessary to requery a combo box after you've selected a row from it.
 
M

Michael

Here is the row source for the combo box:
SELECT FRMQ_ItemCodes.ItemCode, FRMQ_ItemCodes.Cost,
FRMQ_ItemCodes.Description, FRMQ_ItemCodes.ItemType,
FRMQ_ItemCodes.CoreCharge FROM FRMQ_ItemCodes ORDER BY
FRMQ_ItemCodes.ItemCode;

here are some sample R items from the datasheet view of the query:
ItemCode
R-SX0-0000059-000
RB1-8699-000CN
RB1-8945
RB3-0129-020CN
RB3-0161-000CN
RESTOCK
RETAILDEPLOYMENT

Control source: itemcode
bound to column 1

Thanks for your interest.
 
M

Mike Painter

Michael said:
Here is the row source for the combo box:
SELECT FRMQ_ItemCodes.ItemCode, FRMQ_ItemCodes.Cost,
FRMQ_ItemCodes.Description, FRMQ_ItemCodes.ItemType,
FRMQ_ItemCodes.CoreCharge FROM FRMQ_ItemCodes ORDER BY
FRMQ_ItemCodes.ItemCode;

here are some sample R items from the datasheet view of the query:
ItemCode
R-SX0-0000059-000
RB1-8699-000CN
RB1-8945
RB3-0129-020CN
RB3-0161-000CN
RESTOCK
RETAILDEPLOYMENT

Control source: itemcode
bound to column 1

Thanks for your interest.

Itemcode is column zero and cost is column one
 
A

AccessVandal via AccessMonster.com

Michael said:
With certain "Item Codes", it doesn't update. I'm trying to figure

I never really understood the above part. Why do you need to update the "Item
Codes"? According to your code, it doesn't update the data from your combobox.
It only auto populate the data into a table/subform/form.

What I'm guessing is that your combobox width may be too short and the
character length exceeds the combobox field length. What the the combobox
alignment Centre or Right?

You may need to increase the combobox width if that's the case.
 

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