The Mystery: How is this field getting populated ?

M

Mel

I did this Access data base about 3 or 4 years ago and documented
almost all of it... but...

I've got two fields on a subForm that magically get populated.
- There are no Expressions in either of the two fields on the sub
form.

The sub form is built on a query which is built on two tables.
- The two fields are in both the query and in one of the the tables
the query references.
- There are no expressions in the query.
- The subForm is for Items on an Order.

Once the Item, Qty, and Discount have been selected on the subForm...
- the two mystery fields are populated with both the...
....discounted price of a single unit and the
....total discounted price for the order.

I've clicked around on the form looking for some "event" but see
nothing.

Any body got any idea's ?

How do you trigger an event, macro, or code when you leave a form to
go either the next form or next subForm?

Any other idea's?

Thanks for any help.
 
K

kc-mass

Hi Mel,

It could be less direct. Open a module in your application
Go to "Edit\Find\Current project" and enter the name of your control,
"txtMystery?". Remember the control can be updated by an event in
another control and also a sperate module.

You would think it's likely that the code is in an event of "Item, Qty, and
Discount "
controls but look everywhere.

Regards

Kevin
 
M

Mel_3

No luck folks... the automatic population of the two Mystery Fields
remains a mystery !

In response to suggestions so far...

1 - I took a look at Tools | Analyzer | Documenter
for the sub Form and didn't see anything that jumped out at me... how
can I export this to a word file so I can search it?

2 - I guess I didn't use VBA Modules in this project...
- In the Design Window there is nothing under Modules.
- There are lots of Macro's but I can't seem to find one that would
update the two mystery fields upon any event

These two fields are in a subForm (subFormItems) of the Orders Form
(frmOrders)

I've got three other fields in the query that don't get their data
from the tables...
.... they calculate their values based on data in other fields... these
"calculated" fields are
OrderRetailPrice
ItemDiscountedPrice
OrderDiscountedPrice

The two Mystery fields seem to copy the calculated values in the last
two fields above...
and put them in fields in tblItems
DiscPriceItem
DiscPriceOrder

So I guess this copying mus occur after the calculated fields in the
query finish calculating... maybe when the user clicks to either...
.... add another item to the order or
.... create another order or
.... close the Order Form

So, if anyone has any more idea's how I can find out how these two
mystery fields are updated... let me know.

Thanks for all the help.
 
K

KARL DEWEY

how can I export this to a word file so I can search it?
There is an icon on the tool bar - Analyze with Word - when you have the
Tools | Analyzer | Documenter open displaying information on the object.
 
J

Joan Wild

Seems to me it's expected behaviour. Your subform is based on a query
right?

Using Northwind:
SELECT [Order Details].ProductID, Products.ProductName, Products.SupplierID
FROM Products INNER JOIN [Order Details] ON Products.ProductID = [Order
Details].ProductID;

When I choose a ProductID in the query, it automatically fills in the
ProductName and SupplierID, as these are from the '1' side of the 1-M
relationship.

In Help, lookup 'About AutoLookup queries that automatically fill in data'

Joan Wild
MS Access 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

Top