If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Input into one field to generate a value in another
I have a costing form on which users will enter the description of crates to
be used, and the costs will be generated and totalled. There are 10 lines and on some records there may be no crates, on others there may be several. There is a description field and then another field on each line that holds the cost of the crate. This is a fixed amount of 60.00 for each crate that is used. I cannot use a default value of 60.00 as this would lead to a total of 600.00 on every record regardless of whether any crates had been specified or not. I want the value of 60.00 to appear automatically in the cost field on a line ONLY if a user actually enters something in the description field on that line. It should not be triggered by the focus going into a description field, as a user may well tab through all the lines as part of the page navigation. I am assuming it needs a piece of code that will be kicked off On Change, or something like that, in the Description field, and I have tried several expressions but nothing worked! I am sure this is quite simple and somebody will have the answer rightaway? Many thanks CW |
#2
|
|||
|
|||
Input into one field to generate a value in another
CW,
Make the default Price 0.00 Use the AfdterUpdate event of Decription... If Not IsNull(Description) Then Price = 60 Else Price = 0 End if If the user might delete the Description, Price would go back to zero. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "CW" wrote in message ... I have a costing form on which users will enter the description of crates to be used, and the costs will be generated and totalled. There are 10 lines and on some records there may be no crates, on others there may be several. There is a description field and then another field on each line that holds the cost of the crate. This is a fixed amount of 60.00 for each crate that is used. I cannot use a default value of 60.00 as this would lead to a total of 600.00 on every record regardless of whether any crates had been specified or not. I want the value of 60.00 to appear automatically in the cost field on a line ONLY if a user actually enters something in the description field on that line. It should not be triggered by the focus going into a description field, as a user may well tab through all the lines as part of the page navigation. I am assuming it needs a piece of code that will be kicked off On Change, or something like that, in the Description field, and I have tried several expressions but nothing worked! I am sure this is quite simple and somebody will have the answer rightaway? Many thanks CW |
#3
|
|||
|
|||
Input into one field to generate a value in another
Thanks, Al, but this didn't work (at all). No error msge, no effect at all.
Any other suggestions, please! "Al Campagna" wrote: CW, Make the default Price 0.00 Use the AfdterUpdate event of Decription... If Not IsNull(Description) Then Price = 60 Else Price = 0 End if If the user might delete the Description, Price would go back to zero. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "CW" wrote in message ... I have a costing form on which users will enter the description of crates to be used, and the costs will be generated and totalled. There are 10 lines and on some records there may be no crates, on others there may be several. There is a description field and then another field on each line that holds the cost of the crate. This is a fixed amount of 60.00 for each crate that is used. I cannot use a default value of 60.00 as this would lead to a total of 600.00 on every record regardless of whether any crates had been specified or not. I want the value of 60.00 to appear automatically in the cost field on a line ONLY if a user actually enters something in the description field on that line. It should not be triggered by the focus going into a description field, as a user may well tab through all the lines as part of the page navigation. I am assuming it needs a piece of code that will be kicked off On Change, or something like that, in the Description field, and I have tried several expressions but nothing worked! I am sure this is quite simple and somebody will have the answer rightaway? Many thanks CW |
#4
|
|||
|
|||
Input into one field to generate a value in another
CW,
I tested the code, and it works, if your setup is as you stated, and you installed the code properly. This code will not effect any previously entered data. It works as you fill in, or delete, the Description. Go to any record without a Description, and add one... the Price will update to 60. If you already have many records with a default price and no Desc, and you want to put in Price if there is a description, and no Price if not, then you'll have to run a "one time" Update query against the previous records. (using the same logic as my IF) After that, each record will take care of itself as is is added. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "CW" wrote in message ... Thanks, Al, but this didn't work (at all). No error msge, no effect at all. Any other suggestions, please! "Al Campagna" wrote: CW, Make the default Price 0.00 Use the AfdterUpdate event of Decription... If Not IsNull(Description) Then Price = 60 Else Price = 0 End if If the user might delete the Description, Price would go back to zero. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "CW" wrote in message ... I have a costing form on which users will enter the description of crates to be used, and the costs will be generated and totalled. There are 10 lines and on some records there may be no crates, on others there may be several. There is a description field and then another field on each line that holds the cost of the crate. This is a fixed amount of 60.00 for each crate that is used. I cannot use a default value of 60.00 as this would lead to a total of 600.00 on every record regardless of whether any crates had been specified or not. I want the value of 60.00 to appear automatically in the cost field on a line ONLY if a user actually enters something in the description field on that line. It should not be triggered by the focus going into a description field, as a user may well tab through all the lines as part of the page navigation. I am assuming it needs a piece of code that will be kicked off On Change, or something like that, in the Description field, and I have tried several expressions but nothing worked! I am sure this is quite simple and somebody will have the answer rightaway? Many thanks CW |
Thread Tools | |
Display Modes | |
|
|