Can you please try this updated sub:
Code:
Private Sub ProcessVAT(lID, lMinID As Long)
Dim rs As DAO.Recordset
If lID = lMinID Then 'first record
'1a) Set focus to (first) New record in GL subform
Forms!EntryHead!GeneralLedger.SetFocus
'1b) Copy from Main Form to the first row Record in a subform GL:
Forms!EntryHead.GeneralLedger.Form.Account = Forms!EntryHead.Account
Forms!EntryHead.GeneralLedger.Form.CustCode = Forms!EntryHead.CustCode
Forms!EntryHead.GeneralLedger.Form.Refer = Forms!EntryHead.Refer
Forms!EntryHead.GeneralLedger.Form.Debit = Forms!EntryHead.Debit
Forms!EntryHead.GeneralLedger.Form.Credit = Forms!EntryHead.Credit
Forms!EntryHead.GeneralLedger.Form.Narration = Forms!EntryHead.Narration
Else
Forms!EntryHead.SetFocus
Forms!EntryHead!GeneralLedger.SetFocus
DoCmd.GoToRecord
Set rs = Me.RecordsetClone
rs.Filter = "[ID]" = lID
'3. Copy from Main Form to a subform GL (second record):
'copy from Main Form (Refer, Narration)
Forms!EntryHead.GeneralLedger.Form.Refer = Forms!EntryHead.Refer
Forms!EntryHead.GeneralLedger.Form.Narration = Forms!EntryHead.Narration
'4. Copy from VAT Form (COST+VAT):
If cmbVATtr.Value = 0 Then
'copy from VAT form COST data(account,amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("ContraAccount") 'Me.ContraAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("NetValue00") 'Me.NetValue00
ElseIf cmbVATtr.Value = 1 Then
'copy from VAT form COST data(account,amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("ContraAccount") 'Me.ContraAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("NetValue") 'Me.NetValue
'copy from VAT Form VAT data (VAT acc., VAT amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("VATAccount") 'Me.VATAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("VatValue20") ' Me.VatValue20
ElseIf cmbVATtr.Value = 2 Then
'copy from VAT form COST data(account,amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("ContraAccount") 'Me.ContraAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("NetValue") 'Me.NetValue
'copy from VAT form COST data(account,amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("ContraAccount") 'Me.ContraAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("NetValue") 'Me.NetValue
'copy from VAT Form VAT data (VAT acc., VAT amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("VATAccount") 'Me.VATAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("VatValue10") 'Me.VatValue10
ElseIf cmbVATtr.Value = 9 Then
'copy from VAT form COST data(account,amount)
Forms!EntryHead.GeneralLedger.Form.Account = rs("ContraAccount") 'Me.ContraAccount
Forms!EntryHead.GeneralLedger.Form.Debit = rs("NSV") 'Me.NSV
End If
rs.Close
Set rs = Nothing
End If
End Sub
To step through the code put a break on the start of the loop and click the button; the code should stop on that line (the line will be highlighted in yellow). Now keep pressing F8 to move through the code one line at the time.
Cheers,