stephaniechongg
Registered User.
- Local time
- Tomorrow, 02:28
- Joined
- Feb 5, 2016
- Messages
- 15
I have a problem where i have a search bar in the header of a form and in the previous form i set this coding
I want to be able to fill in the search bar but also be able to view the form in a readonly view
is there any way to go around this??
the foding for my search box is as follows
Code:
DoCmd.OpenForm "formname with the search bar", acNormal, , , acFormReadOnly
I want to be able to fill in the search bar but also be able to view the form in a readonly view
is there any way to go around this??
the foding for my search box is as follows
Code:
Private Sub cmdSearch_Click()
If IsNull(txtSearch) = False Then
txtSearch = Me.txtSearch.Value
Task = "SELECT * FROM Product_Steph WHERE ((ProductName Like ""*" & txtSearch & "*"") OR (ProductID Like ""*" & txtSearch & "*"") OR (ProductType Like ""*" & txtSearch & "*"") OR (ProductColour Like ""*" & txtSearch & "*""))"
Me.RecordSource = Task
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
End If
Else
MsgBox "Please enter a value", vbOKOnly + vbInformation, "Sorry"
End If
End Sub