By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,545 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,545 IT Pros & Developers. It's quick & easy.

Add new record, requery to add to table and then open for returning to new record

P: n/a
I have a database where I want to add a new record to a form and then
send out an email based on the newly added information. I need to
requery the database so the appropriate information is included in the
database, so I want to add new record, requery once all information is
The code I am currently using is
Dim myID As Variant
Dim rst As Recordset

If Me.Dirty Then
Me.Dirty = False
End If

myID = Me.Member_ID

If IsNull(myID) Then
RunCommand acCmdRecordsGoToNew
Set rs = Me.RecordsetClone
rs.FindFirst Member_ID = myID
If rs.noMatch Then
MsgBox "Member ID is no longer available"
Me.Bookmark = rs.Bookmark
End If
End If

If Not Me.NewRecord Then
rs.Bookmark = Me.Bookmark
If rs.EOF Then
MsgBox "You're at the last record"
End If
End If

Set rs = Nothing

End Sub

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Not sure exactly what you're trying to do here, but if you want to make
sure the current record is committed to the database before sending an
e-mail, why not just use;

DoCmd.RunCommand acCmdSaveRecord

This will commit the current record and you won't have to phutz around
with all that recordsetclone, refresh, requery stuff. Just launch
straight into your e-mail routine.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.