Database4.zip
HI all,
I am trying to get this Edit button on primary form (Sample DB) to open another form, to specific records in the forms sub forms.
I have done this with a different db but cant seem to get it to work with this one?
I have tried the following code and neither one works correctly. It opens forms but not to specific records.
DB Opens to Primary Form
If you open it, you will see what I mean
Code:
Private Sub cmdEdit_Click()
If Me.cboAccountTypeID = 0 Then
MsgBox "You must select a Record to edit!"
Else
DoCmd.OpenForm "frmSystemCategoryData", , , "Forms!frmSystemCategoryData!sfrmSystemCategoryType.Form!SystemCategoryTypeID = Me.cboAccountTypeID.Column(1)" _
& "Forms!frmSystemCategoryData!sfrmSystemCategory.Form![SystemCategoryID] = Me.cboAccountNameID.Column(1)"
Forms!frmSystemCategoryData!sfrmSystemCategorySub.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
End Sub
Private Sub CmdEdit_Click()
If Me.cboAccountTypeID.Column(0) & "" = "" Then
MsgBox "MsgBox "You must select a Record to edit!"
Else
DoCmd.OpenForm "frmSystemCategoryData"
Forms!frmSystemCategoryData!sfrmSystemCategoryType.SetFocus
DoCmd.FindRecord Me.cboAccountTypeID.Column(1)
Forms!frmSystemCategoryData!sfrmSystemCategory.SetFocus
DoCmd.FindRecord Me.cboAccountNameID.Column(1)
Forms!frmSystemCategoryData!sfrmSystemCategorySub.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
End Sub
Can someone assist me with this?
Thanks
Dave