+ Reply to Thread
Results 1 to 6 of 6

Limit Variable Scope To By Value; Not By Reference.

  1. #1
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    286

    Limit Variable Scope To By Value; Not By Reference.

    Screenshot_1.png

    Is it beyond Access' abilities to alter the scope of the variables to be by value not by reference.

    I would like the values for particular items in labour & material to be scoped to the parent bill. So when there are lots of quotes if you were to change the valueof a labour/ plant item it would only change to that particular bill; not all of the quotes.

    I pray I have explained articulately.
    If it's been helpful please mark as helpful

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    18,795

    Re: Limit Variable Scope To By Value; Not By Reference.

    I think you are showing us a kind of entity-relationship diagram but you haven't followed industry standard conventions so interpreting it requires some assumptions. In particular, I'm not sure why you are showing several Billl [sic] entities when it seems that the Bills entity would include all bills. What attributes does Bills have other than pointing to all the Bill entities?

    Also, By Value and By Reference are not scope, they are argument-passing mechanisms. They apply to programming languages, not databases. You are dealing with entities and attributes, not variables.

    Having gotten that out of the way, solving this requires more information about your data model. It seems that the relation from Labour to Bill is one-to-many. But if you want attributes that are part of Labour to apply only to one particular Bill, then you need to either make that an attribute of Bill instead of Labour.

    Could you describe each of the entities in your diagram along with what attributes it has, and its relationship to other entities? We need to start with Bills, Bill, Labour, and Material.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    286

    Re: Limit Variable Scope To By Value; Not By Reference.

    6String; thank you so much for your detailed reply. Apologies in my belated response but I've been researching your topics in my spare time. Got a bit more to learn so I don't want to waste any more of your time with an insufficient Entity-Relationship diagram (thanks for that terminology there).

  4. #4
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    286

    Re: Limit Variable Scope To By Value; Not By Reference.

    Attachment 751113

    Hopefully this a bit better this time now after a bit more research thanks to your notification of what an ERD is. Still a novice with databases mind.

    Interested only in the below at this time.
    I'm trying to enable optional child databases & can't figure the best way to action as I want to be able to enter the data from tables if possible; I know forms usually better but quite curious as to if it is possible entirely from tables & the drop-downs as in the pic here. Attachment 751114

    Maybe I need to use a bridging table in a different schematic, or maybe it's not possible at all.
    • Bills (Optional 1st Parent)
    • SubBills (Optional 2nd Parent)
    • MainHeaders (Optional 3rd Parent)
    • BillItems (Optional; 3rd Child)

  5. #5
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    18,795

    Re: Limit Variable Scope To By Value; Not By Reference.

    Neither of your attachments worked. If you were trying to attach an image, it seems that you have to click Go Advanced below your post, then add the images. For some reason it won't work if you starting a fresh post.

  6. #6
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    286

    Re: Limit Variable Scope To By Value; Not By Reference.

    Sorry about that, hopefully this has it now.

    EDIT: I've deviated from my original question & I don't think I've made it clear what I'm trying to acheive.

    A BillName will sometimes have a SubBillItem. sometimes it will not.
    Sometimes a BillName will have a MainHeading , sometimes it will not.
    A BillName will always have a BillItemDescription.

    The trouble is I need the option to have the grandchild BillItemDescription nested under the parents. So their content can report under it's grandparent/ parent. Not aggregated but individual records.

    Hopefully that makes sense.
    Attached Images Attached Images
    Last edited by Dal123; 10-11-2021 at 03:32 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Limit scope of Rows(x).Copy to a specfic # of columns
    By PoggiPJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2013, 01:15 PM
  2. [SOLVED] Variable scope
    By yossel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2013, 06:39 PM
  3. variable scope within functions
    By twd000 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-25-2009, 07:01 PM
  4. Variable scope problem
    By tqm1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2007, 02:56 AM
  5. [SOLVED] UNDERSTANDING VARIABLE SCOPE
    By -JEFF- in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-24-2005, 06:05 PM
  6. [SOLVED] Problem in Variable Scope
    By vrk1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2005, 02:06 PM
  7. [SOLVED] Question about variable scope
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2005, 10:06 AM
  8. variable scope
    By mgasparel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2005, 01:32 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1