Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Dec 2006
    Posts
    250
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filtering form with a field not in the form (2003)

    Hello,

    I have a form that uses many fields from different tables. I subsequent added a field call "Password" to one of these tables. I want this form to "On Open procedure" filter the form based on the password supply by the user (I will like to do an Inputbox on the On Open event procedure). Any ideas on how I can do this? Thanks.

  2. #2
    3 Star Lounger
    Join Date
    Mar 2006
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    289
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Filtering form with a field not in the form (2003)

    A little short on information for me. Can you post a stripped version of your database?
    Thanks
    chuck

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filtering form with a field not in the form (2003)

    Perhaps you can do something like this:

    Private Sub Form_Open(Cancel As Integer)
    Dim strPassword As String
    strPassword = InputBox("Please enter the password")
    Me.Filter = "Password = " & Chr(34) & strPassword & Chr(34)
    Me.FilterOn = True
    End Sub

    You'd have to add code to check whether the user actually entered something.

  4. #4
    3 Star Lounger
    Join Date
    Dec 2006
    Posts
    250
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filtering form with a field not in the form (2003)

    Hans,

    I don't have the password field in the form that I want to filter. Will your code work? If I do need to add the field, it looks like it would be unbound which I don't know a lot about. Thanks for your reply though.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filtering form with a field not in the form (2003)

    Can you explain how the form needs to be filtered if the password field is not part of its record source?

  6. #6
    3 Star Lounger
    Join Date
    Dec 2006
    Posts
    250
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filtering form with a field not in the form (2003)

    This is where I need your help. i don't have the field currently in the form. I do have a managerlastName field. I have a table called tblmanager where I have 6 records with managerlastname and passwords. How can I either add the password field to the form or use the table as reference?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filtering form with a field not in the form (2003)

    Sorry, I have no idea what you mean. You'll have to explain in a lot more detail.

Posting Permissions

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