Warm tip: This article is reproduced from stackoverflow.com, please click
ms-access vba

How to Auto populate the data in Sub form to a text-box in Main form?

发布于 2020-03-31 23:01:14

I have a Sub form (in Data sheet view) in my Main form. This datasheet form has 3 fields (namely Process, Detection and System) . I also have 3 text-boxes just below this Sub form (which can be called as ProcessFinal, DetectionFinal and SystemFinal). Is there any way to auto populate the last filled row in the Sub form to these text boxes below? The maximum number of rows that will be used in the sub form is 5.

I am new to Access. Any help is much appreciated.

Questioner
TJ0007
Viewed
51
June7 2020-01-31 20:20

Place 3 textboxes in subform footer section with expressions like: =Last([Process]). These textboxes will not display in datasheet view, however, main form can reference them, like:

=[subform container name].Form.tbxLastProc

Be aware any changes in subform record order or filtering will change what the 'last' record is.