no current record (newbie question)

Jelle

New member
Local time
Today, 10:49
Joined
May 15, 2006
Messages
7
Hi Forum,

Maybe some of you can tell me what is going on here and how to correct it:

I have a form that gets its data from a query that selects status=10.
In the 'send' button code the status is set to 20 so that the record should not appear in the form anymore and the form should show a new record. This works as intended for the first record, but fails after the second record with the 'no current record' error.


Here is the relevant code (probably with some cruft in it as I have been banging my head on this for a day now):
Code:
    Me.Medium.SetFocus
    Me.Dirty = True
    'get a new record
    Me.Refresh
    
    If Me.type = "new" Then
        stDocName = "rptNewCPI"
        stMailSubject = "new CPI"
        stMailBody = "Here is a new CPI typing instruction. Please click the attached file"
    '[some code deleted]
    End If
    
    DoCmd.SendObject acReport, stDocName, acFormatHTML, _
    "myemail@theypaymeforthis.com", , , stMailSubject, stMailBody, True
    
        
    Me.Recordset.Edit
    Me.Recordset!Status = 20
    Me.Recordset.Update
'    Me.Status.Value = 20
'    Me.Dirty = True
'    Me.Refresh
'
    DoCmd.GoToRecord , , acNewRec
    DoCmd.Requery frm_CPI2


(oh and as another newbie question: what does the "!" in object!containedobject syntax do exactly? What is the difference with object.containedobject?)
 

Users who are viewing this thread

Back
Top Bottom