Access 07 Subform GoToRecord, , acNewRec NOT WORKING

Joined
Nov 22, 2012
Messages
1
Reaction score
0
Pulling out my hair...I'm thinking it has to do with the GoToRecord default (acNext)...
Here it goes: App opens to a free text search form (frmAgencySearch) which dynamically filters a listbox - dblclck your listbox choice & it (closes frmAgencySearch and...) opens frmAgencyDetails (based off the listbox selection from frmAgencySearch) which has a tab control with 5 pages (I'm not sure if I'm saying right...). One of the pages/tabs (Notes) on frmAgencyDetails has a listbox (List1) & a subform (frmAddNote). The listbox lists all current "Notes" records, & the subform is meant to be an "Add New Note" only form.
Everything works perfectly...EXCEPT getting the subform to DoCmd.GoToRecord , , acNewRec AFTER a new note record is saved. (it opens as it should, but after a user saves a new note record (sub)frmAddNote defaults back to acNext...not acNewRec)
- Here's what I have in the SUBFORM frmAddNote:
****
Private Sub Command1_Click()
Dim response
If Me.Dirty Then
response = MsgBox("Do you want to SAVE data? Click YES. (Click NO to clear the fields.)", vbYesNo)
If response = vbNo Then
Me.Undo
Else
Me.DiscID = stDiscID
Me.Creator = stCreator
DoCmd.RunCommand acCmdSaveRecord
End If
End If
End Sub
****
Private Sub Form_AfterUpdate()
DoCmd.GoToRecord , , acNewRec
Forms!frmSBAgencyDetail.List1.Requery
****
frmAgencyDetails properties Data Entry, Allow Additions, Deletions, & Edits are all set to YES; HOWEVER... No matter how many times I set/save frmAddNotes to Data Entry = YES, it goes back to the default (no) once a Note record is added. Which means, once a new Note Record is saved, my (sub)frmAddNote displays the "next records details" instead of a new, blank record form.

None of my VBA specifies a particular datamode in the DoCmd.OpenForm ("When the Data Mode argument of the OpenForm action is set, Microsoft Office Access 2007 will override a number of form property settings")

I know it's something simple with the default GotToRecord being acNext...WHAT AM I MISSING??
 
Last edited:
Back
Top