Hi Guys,
I have a search form which consist of a subform. After I tick the SEARCH button, I want to have a SHOW ALL button to show all my data. Please help.
Below are my search Combo Boxes:
Private Sub cbo_Doctype_AfterUpdate()
myDoc = "Select * from MainTable where ([Doc Type]= '" & Me.cbo_Doctype & "')"
Me.MainTable_subform.Form.RecordSource = myDoc
Me.MainTable_subform.Form.Requery
Me.cbo_Subcon = Null
Me.cbo_Status = Null
End Sub
Private Sub cbo_Subcon_AfterUpdate()
myDoc = "Select * from MainTable where ([Subcon]= '" & Me.cbo_Subcon & "')"
Me.MainTable_subform.Form.RecordSource = myDoc
Me.MainTable_subform.Form.Requery
Me.cbo_Doctype = Null
Me.cbo_Status = Null
End Sub
Private Sub cbo_Status_AfterUpdate()
myDoc = "Select * from MainTable where ([Status]= '" & Me.cbo_Status & "')"
Me.MainTable_subform.Form.RecordSource = myDoc
Me.MainTable_subform.Form.Requery
Me.cbo_Doctype = Null
Me.cbo_Subcon = Null
End Sub
I have a search form which consist of a subform. After I tick the SEARCH button, I want to have a SHOW ALL button to show all my data. Please help.
Below are my search Combo Boxes:
Private Sub cbo_Doctype_AfterUpdate()
myDoc = "Select * from MainTable where ([Doc Type]= '" & Me.cbo_Doctype & "')"
Me.MainTable_subform.Form.RecordSource = myDoc
Me.MainTable_subform.Form.Requery
Me.cbo_Subcon = Null
Me.cbo_Status = Null
End Sub
Private Sub cbo_Subcon_AfterUpdate()
myDoc = "Select * from MainTable where ([Subcon]= '" & Me.cbo_Subcon & "')"
Me.MainTable_subform.Form.RecordSource = myDoc
Me.MainTable_subform.Form.Requery
Me.cbo_Doctype = Null
Me.cbo_Status = Null
End Sub
Private Sub cbo_Status_AfterUpdate()
myDoc = "Select * from MainTable where ([Status]= '" & Me.cbo_Status & "')"
Me.MainTable_subform.Form.RecordSource = myDoc
Me.MainTable_subform.Form.Requery
Me.cbo_Doctype = Null
Me.cbo_Subcon = Null
End Sub