This seems like it should be simple but it has stumped me.
I want to place a text box on a form and display one of the fields from the LAST record of the associated table.
Any help would be appreciated.
Thanks.
This seems like it should be simple but it has stumped me.
I want to place a text box on a form and display one of the fields from the LAST record of the associated table.
Any help would be appreciated.
Thanks.
How are you defining last? Last by date? Last by primary key value? Last by some other sorting mechanism?
and is this going to be on a main form or a subform?
I think I would write a query that had the result I wanted as the first record (let's say call it Qry_Lookup)
then use code to find the value within the query, let's say the field that has the result you want is FLD_THISITEM
you could have code behind your form that was something like
dim db as database
dim rst as recordset
set db = currentdb
set rst = db.openrecordset (Qry_Lookup)
rst.movefirst
FormFieldName = rst.fields("Fld_THISITEM")
rst.close
set db = nothing
Where FORMFIELDNAME would be the name of the field where you want the value to display on your current form. This also assumes the query has the record you want the information from as the very first record in the query.