Looping - Text Box in Header - Update Text Box in Detail

  • Thread starter Thread starter Jani
  • Start date Start date
J

Jani

I've been looking/reading how to do this but am stumped. In a header I have
an unbound text box named "txtSelectRequestor"; in the detail section there
are rows of information pulled from a temp table and the number of rows will
vary. Each row has a bound combo field named "cmbRequestor." Because there
could be up to 50 rows and for most of the rows, the requestor will be the
same, I would like to loop through the rows and have the "cmbRequestor" field
updated to the name selected in "txtSelectRequestor." I'm using a combo in
the detail section as the option to make a different selection is necessary.
If anyone can provide some VBA code, it would be so very much appreciated.
Thank you in advance!!!
 
I've been looking/reading how to do this but am stumped. In a header I have
an unbound text box named "txtSelectRequestor"; in the detail section there
are rows of information pulled from a temp table and the number of rows will
vary. Each row has a bound combo field named "cmbRequestor." Because there
could be up to 50 rows and for most of the rows, the requestor will be the
same, I would like to loop through the rows and have the "cmbRequestor" field
updated to the name selected in "txtSelectRequestor." I'm using a combo in
the detail section as the option to make a different selection is necessary.
If anyone can provide some VBA code, it would be so very much appreciated..
Thank you in advance!!!

If all the data in the temp table is just for the given
txtSelectRequestor value, then just use an update query.

dim strSQL as string 'place to build the update query
strsql = "UPDATE MyTable SET RequestorID = '" & me.cmbRequestor & "'"
Currentdb.Execute strsql, dbfailonerror
 
Thanks much Piet! jms

Piet Linden said:
If all the data in the temp table is just for the given
txtSelectRequestor value, then just use an update query.

dim strSQL as string 'place to build the update query
strsql = "UPDATE MyTable SET RequestorID = '" & me.cmbRequestor & "'"
Currentdb.Execute strsql, dbfailonerror
 
Back
Top