Good Morning
I have a form where data is being filtered in an unbound listbox. When the data is filtered I will then double click on the record and will open it in an additional form for viewing etc.
I now however in my listbox have a new field called status.
The status can be, Active, Pending, Inactive or Archive.
I am trying to amend my on "Double click" code so that if the status, is
Active, Pending, Inactive open Form A
and if the status is
Archive it will open Form B
The working code without any errors
I currently get error "Method or Data Member not Found" By Status with the following code
Any help would be appreciated
I have a form where data is being filtered in an unbound listbox. When the data is filtered I will then double click on the record and will open it in an additional form for viewing etc.
I now however in my listbox have a new field called status.
The status can be, Active, Pending, Inactive or Archive.
I am trying to amend my on "Double click" code so that if the status, is
Active, Pending, Inactive open Form A
and if the status is
Archive it will open Form B
The working code without any errors
Code:
Private Sub SearchList_DblClick(Cancel As Integer)
On Error GoTo Err_SearchList_DblClick
Dim db As DAO.Database
Dim rst As DAO.Recordset
DoCmd.OpenForm "FrmA"
Set rst = Forms!FrmA.Recordset.Clone
rst.FindFirst "[ID] = " & Me.SearchList
Forms![FrmA ].Bookmark = rst.Bookmark
DoCmd.Close acForm, Me.Name
Exit_SearchList_DblClick:
Exit Sub
Err_SearchList_DblClick:
MsgBox Err.Description
Resume Exit_SearchList_DblClick
End Sub
I currently get error "Method or Data Member not Found" By Status with the following code
Code:
Private Sub SearchList_DblClick(Cancel As Integer)
On Error GoTo Err_SearchList_DblClick
Dim db As DAO.Database
Dim rst As DAO.Recordset
If Me.SearchList.Status = "Archive" Then
DoCmd.OpenForm "FrmB"
Set rst = Forms!FrmB.Recordset.Clone
rst.FindFirst "[ID] = " & Me.SearchList
Forms!FrmB.Bookmark = rst.Bookmark
DoCmd.Close acForm, Me.Name
Else
DoCmd.OpenForm "FrmA"
Set rst = Forms!FrmA.Recordset.Clone
rst.FindFirst "[ID] = " & Me.SearchList
Forms!FrmA .Bookmark = rst.Bookmark
DoCmd.Close acForm, Me.Name
Any help would be appreciated