I have a Starting form ("frmStart") and a main form ("frmCustomer")
inside frmCustomer are two subform, one with it's own subform. So
frmCustomer has two subforms ("sbfArtist" and "sbfAddress") inside
subform "sbfArtist" is another subform, "sbfTitle"... I'll try to
create a visible heiarchy:
frmStart
----frmCustomer
--------sbfAddress
--------sbfArtist
------------sbfTitle
I hope that helps set up the picture...
Anyway, inside frmStart is a command button that allows the user to
enter a new Address in frmCustomer. The CustomerID is readily available
form frmStart. I don't want to do this with SQL code as I need the
ability to allow the user to back out of creating a new entry and to
edit the fields before it's updated. Inside frmCustomer_Load() I tried
using RunCommand acCmdRecordsGoToNew after setting the focus to the
subform but that did not work.
I load and display the correct CustomerID with:
Private Sub Form_Load() ' frmCustomer
If Me.OpenArgs = "NewBillAddress" Then
With Me.RecordsetClone
.FindFirst "[CustomerID]=" & Forms!frmStart!Customer
If Not .NoMatch Then
Me.Bookmark = .Bookmark
With Me.[sbfAddress].Form
Me.sbfAddress.Form.SetFocus
Me.sbfAddress.Form.addNewRecord
End With
End If
End With
End If
End Sub
That executes without error but fails to set focus to a New record in
sbfAddress
After getting this to work I will attempt to create similar
functionality to the 2-level-subform (frmCustomer>>sbfArtist>>sbfTitle)
and I'm sure I can figure that out if I can just get this to work.
Any help would be greatly appreciated. Thanks!