Hello,
I currently have a single form set up (frmSearch) that has a search bar text box and command button (with VBA code) that enables me to search records in a table.
I was wondering If it would be possible to use a different form (frmSearchBar) as the search bar and then the record information appearing in the form already made.
Therefore I want the search bar form (frmSearchBar) to pop out from the (frmSearch). Once the search bar form is open, there will only be a text box and command button that will search for a record, and once the record is found, the information populates text boxes in the other form (frmSearch). While also closing the search bar form (frmSearchBar).
The current VBA code I use at the moment is:
Private Sub cmdSearchBar_Click()
If IsNull(txtSearchBar) = False Then
Me.Recordset.FindFirst "[Item]='" & txtSearchBar & "'"
Me!txtSearchBar = Null
If Me.Recordset.NoMatch Then
MsgBox "No Item found", vbOKOnly + vbInformation, "Sorry"
Me!txtSearchBar = Null
End If
End If
End Sub
txtSearchBar = the search bar text box.
cmdSearchBar = the command button.
I know that was a bit of a rubbish explanation but hopefully it got my problem across.
Thanks,
Aeonem