sub form issues

bigmac

Registered User.
Local time
Yesterday, 17:31
Joined
Oct 5, 2008
Messages
302
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:
 
include it in the rowsource to your subform as an additional field
 
how do I do that please?
 
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
 
hello arnelgp, how nice to hear from you again , this still does not work mate
 
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

Back
Top Bottom