Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 need help in msaccess, value distribution

views
     
TSjinaun
post Feb 22 2006, 02:57 PM, updated 20y ago

where are my stars???
Group Icon
Elite
6,139 posts

Joined: Jan 2003
i'm using access XP here

need help

how do i distribute a value between 2 fields or more?

say for example..

field 1 - input field
field 2 - value limit is 10, currently no value yet, or if it does have a value and still < 10(value limit) then add on top of it.
field 3 - value limit is 15, currently no value yet, or if it does have a value and still < 15(value limit) then add on top of it.
field n - value limit is n, currently no value yet,or if it does have a value and still < n(value limit) then add on top of it.

lets say i put a value into field 1, after i have inputted and lost focus of that field 1, automatically the value will spread among field 2 to field n+1. while still keeping the initial number in field 1.

eg.. i put in 12 into field 1, and automatically field 2 will become 10(thats the limit of the field value) and balance of 2 will masuk field 3, field 1 still retain value of 12 for the record.

pls advice..


========================

i was thinking of using while..do or some sort of looping to transfer one unit by one unit first while checking for conditions.. but after fulfillinf condition that how do i proceed to next array to fill it up until habis???

This post has been edited by jinaun: Feb 22 2006, 03:57 PM
shinchan^^
post Feb 22 2006, 03:01 PM

K66
*********
All Stars
21,256 posts

Joined: Jan 2003
From: Pekopon


easy la


at the field 2 - control source u put la =(field2.value+field1.value)
TSjinaun
post Feb 22 2006, 03:47 PM

where are my stars???
Group Icon
Elite
6,139 posts

Joined: Jan 2003
i dun think so la..

nvm.. i've reclarified again in the first post.
shinchan^^
post Feb 22 2006, 03:58 PM

K66
*********
All Stars
21,256 posts

Joined: Jan 2003
From: Pekopon


go field1 --> Events-->Onchange Events-->write a Event Procedure

CODE

if field1.value > 10 then
    field2.value = 10
else
if field1.value > 15 then
    field3.value = 15
endif
  .
  .
end if


 

Change to:
| Lo-Fi Version
0.0169sec    0.31    5 queries    GZIP Disabled
Time is now: 24th December 2025 - 01:14 AM