Full Version: Subform refuses to go to a new record
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
MrSiezen
Hi!

Rather frustrating problem here:
With the code of a command button below, I wan't a subform to appear with a new record in focus:

CODE
Private Sub cmdUNB_Click()

Me.subfrmNAW.Form.RecordSource = "l_calls_unbound"
Me.subfrmNAW.Form.visible = True
Me.subfrmNAW.Form.DataEntry = True
Me.unbID = DMax("ID", "l_calls_unbound")

End Sub


But it just keeps showing the first record it finds in it's recordsource. Instead of the DataEntry = True option I also tried a using sub in the subform, with: DoCmd.GoToRecord , , acNewRec.

But nothing.

For testing I added a command button on the subform, and tried both commands after the subform was 'opened'. Now both commands work as they should, moving it to a new record.

What am I missing?
giodev
I would try to add a requery od the subform, like the follwing:

Me.subfrmNAW.Form.RecordSource = "l_calls_unbound"
Me.subfrmNAW.Form.visible = True
Me.subfrmNAW.Form.DataEntry = True
Me.subfrmNAW.Form.Requery
Me.unbID = DMax("ID", "l_calls_unbound")
MrSiezen
Thanks for your reply giodev, but in the meanwhile I switched to a new approach (sorry, had to move along).
But now I'm facing the complete opposite problem. I'll post this problem in a new thread.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.