D
derekwittman
Good afternoon,
I'm working on a small application that contains a combo box to select
integers ranging from 1 - 8. I have txtboxes for each of these
options. Should the user select 3, then 3 txtboxes will be visible,
while the remaining 5 will go visible = no. Each of these textboxes is
waiting for the user to enter a percentage from 1 - 100% such that the
sum total of them all is 100% (another text box). My form is unbound
(faster on the front end). I want to create an event procedure for a
Lost Focus event for textbox1 that updates my "remaining percent"
textbox with 1 - textbox1's value.
My problem is that when I go to the OnLostFocus property and select
either [Event Procedure] or ... it does NOT creat my SUB and End Sub
statements... Does anyone know why this is? VBA opens up to the last
place I was editing - not where it should go.
My "Submit" button will contain code to verify that the sum of the
percents is 100%.
Here is the code for textbox1:
Private Sub txtPC1_LostFocus()
Dim varPC1 As Variant
varPC1 = Forms!frmShortForm.txtPC1
Forms!frmShortForm.txtRemaining = 1 - varPC1
Me.Requery
End Sub
Thank you in advance!
Derek
I'm working on a small application that contains a combo box to select
integers ranging from 1 - 8. I have txtboxes for each of these
options. Should the user select 3, then 3 txtboxes will be visible,
while the remaining 5 will go visible = no. Each of these textboxes is
waiting for the user to enter a percentage from 1 - 100% such that the
sum total of them all is 100% (another text box). My form is unbound
(faster on the front end). I want to create an event procedure for a
Lost Focus event for textbox1 that updates my "remaining percent"
textbox with 1 - textbox1's value.
My problem is that when I go to the OnLostFocus property and select
either [Event Procedure] or ... it does NOT creat my SUB and End Sub
statements... Does anyone know why this is? VBA opens up to the last
place I was editing - not where it should go.
My "Submit" button will contain code to verify that the sum of the
percents is 100%.
Here is the code for textbox1:
Private Sub txtPC1_LostFocus()
Dim varPC1 As Variant
varPC1 = Forms!frmShortForm.txtPC1
Forms!frmShortForm.txtRemaining = 1 - varPC1
Me.Requery
End Sub
Thank you in advance!
Derek