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
|
|||
|
|||
Make text box control source change based on a check box selection
Hello, I am trying to set up a form in a user has to select one of 2 check
boxes: Margin (Check 158) or Markup (Check 160). Then the user will tab down to a text box in which they are supposed to enter a percentage (Text215). Here's my problem: If the user selects Check 160, and enters a percentage in Text215, I need it to perform a formula, and put it in another text box (Text354). However, if Check 158 is selected, the user will enter the percentage into Text215 as usual, and then Text354's value will equal the percentage that is in Text215. I know I probably have to change the control source of Text354 to a formula something like this: =IIf(Check160 Is Not Null, [Text215]/(1+([Text215]/100)),[Text215]...I know I must be close, but I keep getting a #Name? error. Can anyone help? Sorry for all the meaningless control names, and thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#2
|
|||
|
|||
Make text box control source change based on a check box selection
Check boxes have three states - Null (gray), Yes (checked), and No (white).
When the form is opened they are gray unless you have an event/macro to set them. In your case I would suggest using an Option Group as your check boxes could both be the same. "AimeeK via AccessMonster.com" wrote: Hello, I am trying to set up a form in a user has to select one of 2 check boxes: Margin (Check 158) or Markup (Check 160). Then the user will tab down to a text box in which they are supposed to enter a percentage (Text215). Here's my problem: If the user selects Check 160, and enters a percentage in Text215, I need it to perform a formula, and put it in another text box (Text354). However, if Check 158 is selected, the user will enter the percentage into Text215 as usual, and then Text354's value will equal the percentage that is in Text215. I know I probably have to change the control source of Text354 to a formula something like this: =IIf(Check160 Is Not Null, [Text215]/(1+([Text215]/100)),[Text215]...I know I must be close, but I keep getting a #Name? error. Can anyone help? Sorry for all the meaningless control names, and thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#3
|
|||
|
|||
Make text box control source change based on a check box selection
Allow me to clarify: The two check boxes are a part of an option group
(Frame 155), and the value for Margin is 1, and the value for Markup is 2. Basically, if the value is 2, I need the control source of Text354 to be my formula...thanks again. KARL DEWEY wrote: Check boxes have three states - Null (gray), Yes (checked), and No (white). When the form is opened they are gray unless you have an event/macro to set them. In your case I would suggest using an Option Group as your check boxes could both be the same. Hello, I am trying to set up a form in a user has to select one of 2 check boxes: Margin (Check 158) or Markup (Check 160). Then the user will tab [quoted text clipped - 13 lines] Can anyone help? Sorry for all the meaningless control names, and thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#4
|
|||
|
|||
Make text box control source change based on a check box selection
You could do it in a Case statement...
Select Case Me.Frame155 Case 1 strFormula = insert formula here Case 2 strFormula = me.text215 End Select me.text354 = strFormula Keep in mind I'm an Access noob, and this is not tested in any way. It's just an idea to try. d "AimeeK via AccessMonster.com" u15662@uwe wrote in message news:587279a9a367f@uwe... Allow me to clarify: The two check boxes are a part of an option group (Frame 155), and the value for Margin is 1, and the value for Markup is 2. Basically, if the value is 2, I need the control source of Text354 to be my formula...thanks again. KARL DEWEY wrote: Check boxes have three states - Null (gray), Yes (checked), and No (white). When the form is opened they are gray unless you have an event/macro to set them. In your case I would suggest using an Option Group as your check boxes could both be the same. Hello, I am trying to set up a form in a user has to select one of 2 check boxes: Margin (Check 158) or Markup (Check 160). Then the user will tab [quoted text clipped - 13 lines] Can anyone help? Sorry for all the meaningless control names, and thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#5
|
|||
|
|||
Make text box control source change based on a check box selection
Just reread Karl's post, I agree that you would need to do this as Option
Group instead of a Frame (I think), then the case statements I suggested should work... d "Darhl Thomason" wrote in message ... You could do it in a Case statement... Select Case Me.Frame155 Case 1 strFormula = insert formula here Case 2 strFormula = me.text215 End Select me.text354 = strFormula Keep in mind I'm an Access noob, and this is not tested in any way. It's just an idea to try. d "AimeeK via AccessMonster.com" u15662@uwe wrote in message news:587279a9a367f@uwe... Allow me to clarify: The two check boxes are a part of an option group (Frame 155), and the value for Margin is 1, and the value for Markup is 2. Basically, if the value is 2, I need the control source of Text354 to be my formula...thanks again. KARL DEWEY wrote: Check boxes have three states - Null (gray), Yes (checked), and No (white). When the form is opened they are gray unless you have an event/macro to set them. In your case I would suggest using an Option Group as your check boxes could both be the same. Hello, I am trying to set up a form in a user has to select one of 2 check boxes: Margin (Check 158) or Markup (Check 160). Then the user will tab [quoted text clipped - 13 lines] Can anyone help? Sorry for all the meaningless control names, and thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#6
|
|||
|
|||
Make text box control source change based on a check box selection
Darhl, I copied and pasted your code into the AfterUpdate event for Frame155
(which I think is the name of the Option Group), but I keep getting an error saying "You can't assign a value to this object", and when I go to debug the code, it shows this as the offending code: Me.Text354 = strFormula The full code I used is below: Private Sub Frame155_AfterUpdate() Select Case Me.Frame155 Case 1 strFormula = [SPL PERISHABLE PERCENT] / (1 + ([SPL PERISHABLE PERCENT] / [SPL PERISHABLE PERCENT])) Me.Text354 = strFormula Case 2 strFormula = Me.Text215 End Select End Sub Did I do something wrong? Thanks. Darhl Thomason wrote: Just reread Karl's post, I agree that you would need to do this as Option Group instead of a Frame (I think), then the case statements I suggested should work... d You could do it in a Case statement... Select Case Me.Frame155 [quoted text clipped - 34 lines] thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#7
|
|||
|
|||
Make text box control source change based on a check box selection
Okay, I figured this out: I ended up using an IF/THEN STATEMENT and putting
that in the AfterUpdate event of of Text215. I also wrote code for both check boxes in their MouseDown events so the formula could change according to which box was checked. Darhl, Thank you very much...you at least steered me in the right direction. AimeeK wrote: Darhl, I copied and pasted your code into the AfterUpdate event for Frame155 (which I think is the name of the Option Group), but I keep getting an error saying "You can't assign a value to this object", and when I go to debug the code, it shows this as the offending code: Me.Text354 = strFormula The full code I used is below: Private Sub Frame155_AfterUpdate() Select Case Me.Frame155 Case 1 strFormula = [SPL PERISHABLE PERCENT] / (1 + ([SPL PERISHABLE PERCENT] / [SPL PERISHABLE PERCENT])) Me.Text354 = strFormula Case 2 strFormula = Me.Text215 End Select End Sub Did I do something wrong? Thanks. Just reread Karl's post, I agree that you would need to do this as Option Group instead of a Frame (I think), then the case statements I suggested [quoted text clipped - 7 lines] thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
#8
|
|||
|
|||
Make text box control source change based on a check box selection
Aimee,
You're very welcome. I know my idea wasn't exactly what you used, but at least it helped. I think this is the first time I've helped someone in these forums, so I feel a little better about always asking for help myself ;-) Darhl "AimeeK via AccessMonster.com" u15662@uwe wrote in message news:587ccaca8421c@uwe... Okay, I figured this out: I ended up using an IF/THEN STATEMENT and putting that in the AfterUpdate event of of Text215. I also wrote code for both check boxes in their MouseDown events so the formula could change according to which box was checked. Darhl, Thank you very much...you at least steered me in the right direction. AimeeK wrote: Darhl, I copied and pasted your code into the AfterUpdate event for Frame155 (which I think is the name of the Option Group), but I keep getting an error saying "You can't assign a value to this object", and when I go to debug the code, it shows this as the offending code: Me.Text354 = strFormula The full code I used is below: Private Sub Frame155_AfterUpdate() Select Case Me.Frame155 Case 1 strFormula = [SPL PERISHABLE PERCENT] / (1 + ([SPL PERISHABLE PERCENT] / [SPL PERISHABLE PERCENT])) Me.Text354 = strFormula Case 2 strFormula = Me.Text215 End Select End Sub Did I do something wrong? Thanks. Just reread Karl's post, I agree that you would need to do this as Option Group instead of a Frame (I think), then the case statements I suggested [quoted text clipped - 7 lines] thanks in advance for your help. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200512/1 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word applies direct format on File open | Uriel | General Discussion | 16 | November 27th, 2005 07:22 PM |
Add New Field to DB | Karen | Database Design | 7 | October 19th, 2005 08:03 PM |
Help with design | Ronnie | Database Design | 6 | March 12th, 2005 02:53 PM |
Access reports with a horizontal line after each record??? | Bill via AccessMonster.com | Setting Up & Running Reports | 6 | March 9th, 2005 04:51 PM |
Office 2003 installation problem, log file attached.... | Ryan | Setup, Installing & Configuration | 0 | January 20th, 2005 06:57 PM |