Thanks for the tips.
I do have the same data displayed twice. In the top form, I want the users to be able to edit the data using the look of a form. In the bottom subform, I want the users to be able to view all records that come before and after the current record that is displayed in the top form. The bottom form is a datasheet view and the top form is a form view. There is going to be something like 40,000 records in the DB, and users have expressed that they would like to see other records around the current record. It may be best to just do one form in the datasheet view so that they can see all records that way, and then just lock down the fields I don't want users to edit.
I figured out how to set the recordsource equal to the search. Everything works fine when I search for something that is in the database. If I search for something that can't be found, my page disappears and I have to refresh it to get the form back. My code is below. I'm thinking I could create a temporary search and run a statement that said If tempsearch is null then cancel action, but I am not sure how to code that. I have never worked with VB
before so I am trying to pick it up as I go. Any thoughts if this would work and how something like this would be structured?
Private Sub cmdSearch_Click()
Dim varWhere As Variant
If IsNull([txtSearchBox]) Then
Ok = General.Err_msg("The search feild is mandatory." & Chr(10) & Chr(10) & "Please enter a search item.")
Me.RecordSource = _
"SELECT * FROM [tbl11I_BANK_BRANCH_ALL] " & "WHERE [11I_BANK_NAME] Like Forms![frm11I_BANK_BRANCH_ALL].[txtSearchBox]"