D
David Whitaker
I am trying to populate ahead 2 new records with
If Me.items = 2 Then
Forms!cpurchase.po = DMax("po * 1", "cpart") + 1
Forms!cpurchase.pofinal = Forms!cpurchase.po & "a"
Forms!cpurchase.posub = 1
Forms!cpurchase.pocount = 2
DoCmd.GoToRecord , , acNewRec
Forms!cpurchase.po = DMax("po * 1", "cpart")
Forms!cpurchase.pofinal = Forms!cpurchase.po & "b"
Forms!cpurchase.posub = 2
Forms!cpurchase.pocount = 2
Exit Sub
End If
but what is happening
when I step into the code it does fine, but when you let it run on its own
it only populates the 1st record as the second record
Where have I gone wrong?
If Me.items = 2 Then
Forms!cpurchase.po = DMax("po * 1", "cpart") + 1
Forms!cpurchase.pofinal = Forms!cpurchase.po & "a"
Forms!cpurchase.posub = 1
Forms!cpurchase.pocount = 2
DoCmd.GoToRecord , , acNewRec
Forms!cpurchase.po = DMax("po * 1", "cpart")
Forms!cpurchase.pofinal = Forms!cpurchase.po & "b"
Forms!cpurchase.posub = 2
Forms!cpurchase.pocount = 2
Exit Sub
End If
but what is happening
when I step into the code it does fine, but when you let it run on its own
it only populates the 1st record as the second record
Where have I gone wrong?