benkingery
Registered User.
- Local time
- Today, 02:27
- Joined
- Jul 15, 2008
- Messages
- 153
I have a form where I am entering values into several fields. These fields will contain numbers that will need to be inserted into various inventory account tables to show inventory transfers from one allocated location to another.
For example, I have 10 pcs allocated to 4 different channels and I want to move that inventory around as needed. On the form I am creating, I have 4 unbound controls each signifying the amount to transfer. If an amount is to be transferred from one inventory account to another, the net change numbers are placed into the unbound fields. For example, if I want to take channel 1 down by 5 pcs, I enter "-5". If I want to them add those 5 pcs back into channel 4, then I enter "5" on channel 4.
Here is the reason for my question. Since these are unbound forms, I'm getting some wierd stuff when I'm trying to sum up the changes. I am programming in a piece that will not let the user continue to post the changes to the various inventory control accounts unless the SUM of the changes is ZERO. I don't want to create or destroy invnetory, so I'm trying to control it by equal and opposite reactions.
My controls are called "Ctrl1", "Ctrl2", "Ctrl3", "Ctrl4". My sum control is called CtrlSUM, and its records source is "=Nz([Ctrl1],0)+Nz([Ctrl2],0)+Nz([Ctrl3],0)+Nz([Ctrl4],0)). Now, if I enter "1" into Ctrl1, the CtrlSUM displays "1". If I enter "1" into Ctrl1 AND Ctrl2, I get "11". If I enter "1" into Ctrl1 and Ctrl2, and "2" into Ctrl3, then I get "112" in CtrlSUM. Now you can see why I'm scratching my head. Then if I make Ctrl1 null and leave all the other values, it sums up as it should......
I'm very confused. Any help out there on this strange problem?
Thanks,
For example, I have 10 pcs allocated to 4 different channels and I want to move that inventory around as needed. On the form I am creating, I have 4 unbound controls each signifying the amount to transfer. If an amount is to be transferred from one inventory account to another, the net change numbers are placed into the unbound fields. For example, if I want to take channel 1 down by 5 pcs, I enter "-5". If I want to them add those 5 pcs back into channel 4, then I enter "5" on channel 4.
Here is the reason for my question. Since these are unbound forms, I'm getting some wierd stuff when I'm trying to sum up the changes. I am programming in a piece that will not let the user continue to post the changes to the various inventory control accounts unless the SUM of the changes is ZERO. I don't want to create or destroy invnetory, so I'm trying to control it by equal and opposite reactions.
My controls are called "Ctrl1", "Ctrl2", "Ctrl3", "Ctrl4". My sum control is called CtrlSUM, and its records source is "=Nz([Ctrl1],0)+Nz([Ctrl2],0)+Nz([Ctrl3],0)+Nz([Ctrl4],0)). Now, if I enter "1" into Ctrl1, the CtrlSUM displays "1". If I enter "1" into Ctrl1 AND Ctrl2, I get "11". If I enter "1" into Ctrl1 and Ctrl2, and "2" into Ctrl3, then I get "112" in CtrlSUM. Now you can see why I'm scratching my head. Then if I make Ctrl1 null and leave all the other values, it sums up as it should......
I'm very confused. Any help out there on this strange problem?
Thanks,