sub form issues (1 Viewer)

bigmac

Registered User.
Local time
Today, 15:00
Joined
Oct 5, 2008
Messages
295
hi all can you help please , I have a subform with two fields [weld standard] and one [weld code] every time the subform changes i.e number of rowes I want to be able to look at value in [weld standard] and depending on value change the value in [weld code] for each row , I have tried this code

If Me.Welding_code.Value = "IX" Then
Me.weld_code.Value = 2
and put it on the after update of the [weld standard]and works ok but I need it to look at each row , look at each [weld standard] and change [weld code] value .
ant ideas please:confused:
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:00
Joined
Feb 19, 2013
Messages
16,610
include it in the rowsource to your subform as an additional field
 

bigmac

Registered User.
Local time
Today, 15:00
Joined
Oct 5, 2008
Messages
295
how do I do that please?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:00
Joined
May 7, 2009
Messages
19,229
use the form's After Update event:
Code:
Private Sub Form_AfterUpdate()
With Me.Recordsetclone
   If Not (.bof and .eof) then .movefirst
      While Not (.eof)
          If !weld_code = "IX" Then
             .Edit
             !weld_code = 2
             .Update
          End If
          .MoveNext
       Wend
   End If
End With
End Sub
 

bigmac

Registered User.
Local time
Today, 15:00
Joined
Oct 5, 2008
Messages
295
hello arnelgp, how nice to hear from you again , this still does not work mate
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:00
Joined
Feb 19, 2013
Messages
16,610
assuming your rowsource is a table name, you need to change it to a query - e.g.

Code:
SELECT *, iif(welding_code="XI",2) as weld_code
FROM myTable
 

Users who are viewing this thread

Top Bottom