Hi Chaps,
i Hope you can help im running into problems with this code....
	
	
	
		
It's getting stuck on the "rst.MoveNext" lines (both) and im not sure why. the error that it throws up is "invalid object or no longer set".
Its doing what its suppoost to do on the 1st line of the subform and then stops, any help would be appreciated.
 i Hope you can help im running into problems with this code....
		Code:
	
	
	Private Sub OrderType_AfterUpdate()
Dim TmpTxtHeading As String
Dim NewTxtHeading As String
Dim rst As Recordset
Set rst = Me.FRmQ_OrderItemSUB.Form.Recordset
Me.OrderMainText = Me.MainQtext
Me.DocumentsInc = Me.DocsIncTxt
    If Me.OrderType = "Specification" Then
        Me.PONo.Visible = True
        Me.SpecNo.Visible = True
        Me.OrderPrintDate.Visible = True
      
        If Me.[FRmQ_OrderItemSUB].Form.RecordsetClone.RecordCount > 0 Then
            Do While Not rst.EOF
                TmpTxtHeading = Me.FRmQ_OrderItemSUB.Form!OrderItem_Spec_Heading
                NewTxtHeading = Replace(TmpTxtHeading, "OPTIONS AVAILABLE:", "OPTIONS DECLINED:")
                Me.FRmQ_OrderItemSUB.Form!OrderItem_Spec_Heading = NewTxtHeading
            rst.MoveNext
            Loop
        End If
    End If
    If Me.OrderType = "Quotation" Then
        Me.PONo.Visible = False
        Me.PONo.Value = Null
        Me.SpecNo.Visible = False
        Me.SpecNo.Value = ""
        Me.OrderPrintDate.Visible = False
        Me.OrderPrintDate.Value = ""
            If Me.[FRmQ_OrderItemSUB].Form.RecordsetClone.RecordCount > 0 Then
                Do While Not rst.EOF
                    TmpTxtHeading = Me.FRmQ_OrderItemSUB.Form!OrderItem_Spec_Heading
                    NewTxtHeading = Replace(TmpTxtHeading, "OPTIONS DECLINED:", "OPTIONS AVAILABLE:")
                    Me.FRmQ_OrderItemSUB.Form!OrderItem_Spec_Heading = NewTxtHeading
                rst.MoveNext
                Loop
            End If
    
    End If
End SubIt's getting stuck on the "rst.MoveNext" lines (both) and im not sure why. the error that it throws up is "invalid object or no longer set".
Its doing what its suppoost to do on the 1st line of the subform and then stops, any help would be appreciated.
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
		
			
		
		
	
								
							
							 
	 
 
		 
 
		
 
 
		