Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Implementing a subform-type link with a form (Access 2K, Win 2KPro, SQL S

    The project I am working on has several different screens used to handle aspects of case referrals. One of the nice things about implenting subforms is the ID number will automatically get written to the subform table when a new subform record is opened. I'd like to do the same thing on a completely separate form to save space (and perhaps confusion) in terms of the UI. However, i am having trouble getting that new record with parent field ID deal to work across separate forms. Is this sort of thing possible/recommended? I have tried some things setting the source on from B to the pertinent fields on a form A to pre-populate fields, but that doesn't transfer the actual data to the form B table (not all that suprising really).

    I will continue banging away on things like Forms![FieldName].value in code but wanted to see if there's any advise on this issue.

    TIA

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

    Re: Implementing a subform-type link with a form (Access 2K, Win 2KPro, S

    You could set the Default Value of the ID field in Form B to the value of ID in Form A in the On Load event of Form B.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Implementing a subform-type link with a form (Access 2K, Win 2KPro, S

    I've been trying that and keep getting 'Access can't find x form', so I'm sure there's a syntax issue... wait, I know! use the Expression Builder dealie to get the right syntax...

    hopefully that'll work. sometimes i need to talk these things out to get the brain out of a rut. <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Implementing a subform-type link with a form (Access 2K, Win 2KPro, S

    hmmm... don't think the onload thing is going to work. the problem is, i need to pull up the form for various things, including viewing existing data. so I can't just have the thing try and write data to an existing field. an overall concern I have is to be able to re-display information in different forms and keep new records tied to other tables, so the subform structure does a pretty good job, even if it's a bit ugly to look at and takes up too much space. i need to consider what I am doing in terms of structuring the data in the tables, basically.

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

    Re: Implementing a subform-type link with a form (Access 2K, Win 2KPro, S

    You shouldn't write to existing fields, you should set the Default Value property of the ID control/field. This will only affect new records, not existing ones.

Posting Permissions

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