Note that neither a DLookUp nor a text literal will be updateable...
So far it's working. I have the DLookup executing from the main form change
event (only if record is not new) and from the subform combobox's
after_update. I need to add a few more dummy records and make sure all
contingencies are covered.
If you're having trouble post the SQL view of the form and subform's
recordsource and a bit more information about what you're trying to
accomplish.
Thank you! You actually helped me already in another thread.
Having a single textbox on a mainform dependent on a combo box on
a subform (which could represent thousands of records) seems suspect to
me!
It's a conceit really. The app is for my wife's hobby jewelry business.
The subform's record source is a query run on the join table between Items
and Status. The subform has a combobox for status (eg. construction
finished, for sale, placed on consignment, sold, etc. - just a few, not
thousands) and a text box formatted for date (when the status changed). The
subform is to track the progress of jewelry making , from construction
through sale, for each item in inventory. So every time an item's status
changes, she can add a record to the subform, choosing status in the combo
box and the date in the text box. The conceit of the text boxes on the
*main form* is to show the status with the *latest* date - ie. the latest
entry in the subform. Just for easy visualization in the main form as she
scrolls through the inventory. It's not necessary, but it improves the
esthetics, and I wanted to learn how to do it. You helped by pointing me to
the notion of a query with a subquery using DMax. I run that on the join
table from which the subform is generated. That gives a dataset with only
the *latest* status and date for each item of jewelry (of which there'll
probably never be more than several hundred), and that becomes the domain of
the DLookup, whose criteria gives the row for the *current* item of jewelry
in the main form. Hope that conveys the flavor of the project.
No immediate coding issue that I can see. I'm sure there'll be more as I
implement tabs or new forms for other tables in my design (suppliers,
customers, craft show contacts, etc.). Thanks for the offer. Will post if
new issues arise. -Ron
Incidentally, the original motivation behind all this - aside from the
simple kick I get from it - is to create a prototype of a data-driven
website. I thought to model a MySQL/PHP app from it. But I see now that
Access 2010 will have direct website capability. I'm hoping that will make
the process even easier. (Those "where's my website?" questions are getting
a tad more frequent...
)