PhoenixofMT
Part-time Access Guru
- Local time
- Today, 11:59
- Joined
- Jul 23, 2008
- Messages
- 35
I'm having trouble passing data between subforms on my new navigation form (frmNavigator). Before, I just used OpenArgs and the Split function in the opened form's OnLoad.
I'm trying to keep it simple (haha) by using my existing forms as subforms.
So, I have a subform--frmSCLEdit--that displays information about a program (what it does, who wrote it, other files required to use it, etc.) Part of this form is a (display only) subform that displays information about revisions that have been made to each program. On the edit form I have a button to allow the user to open another form--frmSCLChanges--to record new revision information. Ideally, the name of the program from the edit form will be automatically entered in the correct control in a new record on the revision form. When the revision form is closed, it refreshes the edit form to update its subform.
I've managed to get the DoCmd.BrowseToForm to work, but now I'm having trouble passing the program name. What I've tried so far is along the lines of:
For some reason the acFormAdd in the BrowseTo line doesn't seem to be having an effect. When the user navigates manually to the revision form, they should be able to browse through the records. When they are sent there from the edit form, I want it to be in data entry mode. The stuff in the With block came from another site but throws errors all over the place.
.Form.SetFocus throws error 2449: "There is an invalid method in an expression."
.Form!cmbCTPProgName.SetFocus gives error 2105: "You can't go to the specified record."
RunCommand acCmdRecordsGoToNew gives error 2046: "The command or action 'RecordsGoToNew' isn't available now."
.Form!cmbCTPProgName = strDefault gives error 2448: "You can't assign a value to this object."
For now I just have the form opening by itself.
Thought I just had:
Invisible text boxes on the navigation form to be place-holders in lieu of the OpenArgs?
Anyone have any ideas?
I'm trying to keep it simple (haha) by using my existing forms as subforms.
So, I have a subform--frmSCLEdit--that displays information about a program (what it does, who wrote it, other files required to use it, etc.) Part of this form is a (display only) subform that displays information about revisions that have been made to each program. On the edit form I have a button to allow the user to open another form--frmSCLChanges--to record new revision information. Ideally, the name of the program from the edit form will be automatically entered in the correct control in a new record on the revision form. When the revision form is closed, it refreshes the edit form to update its subform.
I've managed to get the DoCmd.BrowseToForm to work, but now I'm having trouble passing the program name. What I've tried so far is along the lines of:
Code:
Dim strDefault As String
strDefault = Me.txtProgName
If HasParent Then
DoCmd.BrowseTo acBrowseToForm, "frmSCLChanges", "frmNavigator.NavigationSubform", , , acFormAdd
With [Forms]!frmNavigator!NavigationSubform
.Form.SetFocus
.Form.DataEntry = True
.Form!cmbCTPProgName.SetFocus
RunCommand acCmdRecordsGoToNew
.Form!cmbCTPProgName = strDefault
End With
Else
DoCmd.OpenForm "frmSCLChanges", acNormal, , , acFormAdd, , Me.Name & ";" & Me.txtProgName & ";" & "False"
End If
For some reason the acFormAdd in the BrowseTo line doesn't seem to be having an effect. When the user navigates manually to the revision form, they should be able to browse through the records. When they are sent there from the edit form, I want it to be in data entry mode. The stuff in the With block came from another site but throws errors all over the place.
.Form.SetFocus throws error 2449: "There is an invalid method in an expression."
.Form!cmbCTPProgName.SetFocus gives error 2105: "You can't go to the specified record."
RunCommand acCmdRecordsGoToNew gives error 2046: "The command or action 'RecordsGoToNew' isn't available now."
.Form!cmbCTPProgName = strDefault gives error 2448: "You can't assign a value to this object."
For now I just have the form opening by itself.
Thought I just had:
Invisible text boxes on the navigation form to be place-holders in lieu of the OpenArgs?
Anyone have any ideas?