M
Matt P
form 1= "frmContactsAddSplit" (the original form the user starts at)
form 2= "frmContactsAdd(New)" (where the user gets sent after they
click on a listbox (lbxSortAdd) and then a button
subform 1= "subCompanyAddresses1"
subform 2= "subAdjusters2"
So all in all there are 4 four forms. I called form 2 from form 1
obviously. Form 2 is a bound form with two subforms. My final result
will be to get the form 2 and sub form 1 to be filled in with the
correct ID's from the other form and a new record in subform 2.
Here is my code from the button on frmContactsAddSplit (form 1):
Private Sub cmdANAdj_Click()
Dim strCriteria As String
strCriteria = "[ID]=" & Me![Company Name]
DoCmd.OpenForm "frmContactsAdd(NEW)", , , strCriteria
Forms![frmContactsAdd(NEW)]![tblCompanyAddresses subform].SetFocus
'DoCmd.GoToRecord , Me.txtAddressID, acGoTo, Forms!
[frmContactsAddSplit]![lbxSortAdd]
End Sub
I have the last part commented out because I still haven't got the
code to setfocus on the right subform... with the code that I have it
sets the focus on subform 2... Does anyone know why this is? It
should be putting the focus on subform 1. Anyways I have tried so
many different ways around this... anyone got any ideas for why this
may be happening?
Thanks,
Matt Pierringer
form 2= "frmContactsAdd(New)" (where the user gets sent after they
click on a listbox (lbxSortAdd) and then a button
subform 1= "subCompanyAddresses1"
subform 2= "subAdjusters2"
So all in all there are 4 four forms. I called form 2 from form 1
obviously. Form 2 is a bound form with two subforms. My final result
will be to get the form 2 and sub form 1 to be filled in with the
correct ID's from the other form and a new record in subform 2.
Here is my code from the button on frmContactsAddSplit (form 1):
Private Sub cmdANAdj_Click()
Dim strCriteria As String
strCriteria = "[ID]=" & Me![Company Name]
DoCmd.OpenForm "frmContactsAdd(NEW)", , , strCriteria
Forms![frmContactsAdd(NEW)]![tblCompanyAddresses subform].SetFocus
'DoCmd.GoToRecord , Me.txtAddressID, acGoTo, Forms!
[frmContactsAddSplit]![lbxSortAdd]
End Sub
I have the last part commented out because I still haven't got the
code to setfocus on the right subform... with the code that I have it
sets the focus on subform 2... Does anyone know why this is? It
should be putting the focus on subform 1. Anyways I have tried so
many different ways around this... anyone got any ideas for why this
may be happening?
Thanks,
Matt Pierringer