Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    35

    Unanswered: Way to Automatically Enter a Field in a Subform

    I am working on a form 'Cases' with a subform 'Procedures' that lists all the procedures for each case - this could vary from 0 to infinity. However, there is always one primary procedure - which is marked as a field of which only 'primary' or 'secondary' can be selected. Procedures is its own table.

    Now, on the form Cases, I'd like to have a set of fields that they can enter Procedures data in but have it automatically select Procedure_stage=Primary. Perhaps with the caption "Enter Primary Procedure Here" Then another set of the same fields would automatically set this field as "secondary". Is there any way to do this?

    I've set Enabled=no, and from a data entry standpoint it works, but when you view records, if there is only one procedure, it will list twice - once in the Primary section, and once in the other section.

    Any help is much appreciated.

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    The answer to your question is Yes. Don't quite understand what you are trying to do, however.

    You have a parent for and a sub form. The sub form items are either A or B (primary or Secondary).

    When you only have one record on the sub form, it shows up twice (A and B) even though it's only A?

    Or, do you have sub form record that appears on the parent form (the first A type record) and this record also shows up on the sub form?

    What is the "Primary Section" and the "Other Section"? Do you have 2 sub forms?

    tc

  3. #3
    Join Date
    Sep 2003
    Posts
    35
    tcace,

    To answer your question, I have two subforms - one with a default value of "Primary" and that field disabled. I have another subform (pulling from the same table) but with a default value of "Secondary" and that field also disabled. Entering data using these two subforms accurately labels them "Primary" and "Secondary", respectively. However, viewing these records presents this double listing problem. So even if a record is marked "Primary" in the table, it will still show up in both subforms.

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    gottcha - sorry 'bout that, my coffe has been sitting here undrunk, and of course the caffine doesn't work as well in the cup.

    You need to filter. Either put a filter on each sub form (open the sub form by itself and set the properties) or create 2 queries that filter for you and link the sub forms to those queries.

    Since a form filter requires turning the filter on after the form is opened, I suggest using queries.
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

  5. #5
    Join Date
    Sep 2003
    Posts
    35
    Excellent. Filters was the ticket! Thanks tcace

Posting Permissions

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