Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002

    Unanswered: Don't save a record or field when the FOCUS moves to a other control

    I have a Form that is based on table. This Form I am using is for searching a particular record in a table. There are lots of fields that are filled when the Form pops-up. And the user can use the NavigationButtons to move arround in the records. Also the user can type in a value in any of the fields and hit a button that then searches a table and if finds any matches to that particular fields pops-up a message saying so many records exsists. Now my problem is if the user types in any value and hit the search button that value is being saved first in the table and then returns a record matching that value exsist. As I want to search whatever is in the table and the user types in a value to search for. So how can I stop Access to save the record and only search whatever is typed in the field without saving it to a table. Means I don't want to save whatever is typed I just want to search against whatever is typed in the field. Is there a way to stop this save. I have lot of fields on my form and the user can type in of the field.

    As each control on the Form is bound to a specific field in a Table. So when I type anything in any control it looks for that value in a table's field bound to that control. And this way I know what field to search in the table. And it's more convenient rather than having an unbound control to type in for the search value. This way I won't know what field to search in. So any tip in this scenario I'll really appreciate.
    Thanks for any help.

  2. #2
    Join Date
    May 2002
    Atlanta, GA
    Have you disabled your menus? If not why don't you have your users use the filter by form option. This will allow them to filter on any field without having to enter data in the Control Source.

    Otherwise, you may have to create unbound fields for searching throught recordsets. Something like this:

    Create Combo Boxes with the values in your columns, then choose the After_Update Event and use code like this:

    Private Sub ComboBox_After_Update()
    Dim myrecordset As Object
    Set myrecordset = Me.Recordset.Clone
    rs.FindFirst "[YourField] = " & Str(Me![ComboBox])
    Me.Bookmark = rs.Bookmark
    End Sub

    Hope this is what you were talking about.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts