Copy data to text boxes

D

DanRoy

I have a subform which displays several lines of data, with all records
selected based a a field in the master. In addition, I added several text
boxes at the bottom of the screen to indicate a "selected" row of data.
There are several text boxes that will be filed in by the user. When the
user is satisfied, i have a command box which will take the valus in the test
boxes and save a new record to an update table.

I am trying to write some code such that whenever there is a click on a row
on the subform, the values from 4 of the fields are copied to 4 of the text
boxes below, indicating the selected record is ready to update.

How would I go about writing the code to copy the field data? I tred
various combinations of the following to no avail:

Text4.value = [DashMaster Subform].[Form]![Field1]
Text6.value = [DashMaster Subform].[Form]![Field2]
Text8.value = [DashMaster Subform].[Form]![Field3]
Text10.value = [DashMaster Subform].[Form]![Field4]

Errors says no object is selected

When i use the following ti says it does not recognize the !:

[DashMaster Subform].[Form]![Text4.value] = [DashMaster
Subform].[Form]![Field1]

etc.

Any suggestions?
 
J

Jeff Boyce

Take a look at the "Parent." property of the subform in Access HELP.

Take a look at the syntax for referring to forms/subforms controls ... I
believe it's something like:

Forms!MainForm!subformControl.Form!ControlOnSubform

Regards

Jeff Boyce
Microsoft Office/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