Update field with another one

J

jeanulrich00

Hi

I have an unbound text field on a form "Text331". Let says this text
field shows "01"

In this form I have a subform name "F-Avant". This subform is
continuous and show 600 records

this subform is linked to a table name "T-Cumul"

Subform "F-Avant" shows all fields of the table "T-Cumul"

Between all fields there is one named "Avancement". I also have
fields name "01", "02", "03" ...

After I have fill field "Avancement" (600 records)

What I want to do is

If the unbound field "Text31" shows "01" I want to updated field "01"
with "Avancement" for ALL the 600 records in the table

If the unbound field "Text31" shows "02" I want to updated field "02"
with "Avancement" for ALL the 600 records in the table.

Thanks a lot for helping because right now I am stuck
 
D

Douglas J. Steele

Run an Update query. Assuming that Avancement is a text field, you'd use

Dim strSQL As String

strSQL = "UPDATE [T-Cumul] SET Avancement = '" & Me.Text331 & "'"
CurrenDb.Execute strSQL, dbFailOnError

Exagerated for clarity, that's

strSQL = "UPDATE [T-Cumul] SET Avancement = ' " & Me.Text331 & " ' "

If Avancement is actually a numeric field, you only need

strSQL = "UPDATE [T-Cumul] SET Avancement = " & Me.Text331
 

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

Similar Threads


Top