#  Other Applications & Softwares  > Access Tables & Databases >  >  Limit Variable Scope To By Value; Not By Reference.

## Dal123

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.

----------


## 6StringJazzer

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.

----------


## Dal123

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).

----------


## Dal123

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)

----------


## 6StringJazzer

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.

----------


## Dal123

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.

----------

