urm, yeah... I've been tackling with a form for a while and kept coming up with a "cannot go to specific record" error... I decided to check in the tables to start again - and it turns out it adds nearly 1,000 blank records before giving me the error. - so after deleting nearly 100,000 blank records I've gone through my code to see if there are any loops or traps... and I can't see any?
On Load = blank out subform, continue to NewForm. (On Current - occurs on page navigation)
NewForm = set customer ID, changes focus
TillOpen - activated after a transaction = stamps date, works out if change is required or not, saves info, prints receipt, sale end
SaleEnd = Change text until something happens, changes focus, saves info, clears dirty, *tries to go to next record
I don't know why it thinks it needs to add 1,000 records?
Code:
Private Sub Form_Current()
Me.[Quote or Invoice] = "I"
Me.Recordset.AddNew 'makes subform blank
NewForm
End Sub
Private Sub Form_Load()
Me.[Quote or Invoice] = "I"
Me.Recordset.AddNew 'makes sub form blank
NewForm
End Sub
Public Sub NewForm()
CustomerID = "1"
Me.Z1Number.SetFocus
Me.CASH.Enabled = False
Me.CARD.Enabled = False
Me.CHEQUE.Enabled = False
Me.LCDtxt = "N"
End Sub
Public Sub TillOpen()
Me.Date_Paid = Now()
Me.Refresh
DoCmd.OpenReport "Report1", acViewNormal, , "InvoiceID = " & Me.InvoiceID
SaleEnd
End If
Public Sub SaleEnd()
Me.LCDtxt = "END"
Me.Z1Number.SetFocus
Me.Refresh
Me.Dirty = False
DoCmd.GoToRecord , , acNewRec
End Sub
On Load = blank out subform, continue to NewForm. (On Current - occurs on page navigation)
NewForm = set customer ID, changes focus
TillOpen - activated after a transaction = stamps date, works out if change is required or not, saves info, prints receipt, sale end
SaleEnd = Change text until something happens, changes focus, saves info, clears dirty, *tries to go to next record
I don't know why it thinks it needs to add 1,000 records?