Results 1 to 3 of 3

Thread: [RESOLVED] Hide fields from an open recordset.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Resolved [RESOLVED] Hide fields from an open recordset.

    Hey all,
    Is there any way to prevent fields from opening in a recordset field list without actually removing the field from the recordset?

    Basically, I've created a customer search window for my database app. The search window can be opened from any other window in the app and simply passed an ADO RS. From there it will show all fields, allow the user to search on all fields, etc. The problem is that I cannot find any other way to pass the selected result back to the owner window without using a bookmark, which I don't have a problem doing. The only problem with using a bookmark is that the recordset passed to the search window must either be the same or a clone of the recordset I'm using in the owner window. Obviously, there are some fields that the user will have no idea about - such as primary key values or other such values. I'd like to somehow hide these fields from the user so that they're not displayed.

    When the search form opens the collection of fields to use is derived directly from the recordset passed to it. The only idea that I can think of is to have the user populate the field collection before the form is shown. The end goal of the search form though is to make things automatic - how automatic is it if there needs to be a 50 line sub to initialize it..

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Hide fields from an open recordset.

    Assuming that the majority of fields will be shown to the user, what I would do is use an array/paramarray (or possibly a database table) containing a list of the fields to hide on the search form, eg:
    Code:
    YourSearchRoutine otherParams, Array("ID1", "ID2")
    The search code could then simply ignore those fields.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Re: Hide fields from an open recordset.

    Yeah, that what I eventually ended up doing. After a great deal of thought I realized I can jsut have a property on the search form that could be set with a comma delimited value of fields. It would iterate through all fields when it populated the results, and if the field is not supposed to be shown, then it would simply hide that particular one - very similar to what you did.

Posting Permissions

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



Click Here to Expand Forum to Full Width