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
|
|||
|
|||
Disable text box via Combo box
Hey,
Can any one see if that can help? I want to disable certain fields when a certain value is selected in a combo box. I have a form called "Expenses" and within that a subform "GeneralExpenses_subform". On the subform form when you select a value other than "Mileage" from the combo box "ExpenseType" i want "VisitMileage","VehicleMileage" and "MileageRate" to be disabled so that no data can be written in to them on that particluar record. Cheers Nathan |
#2
|
|||
|
|||
Disable text box via Combo box
Kurt,
On the AfterUpdate event of cboExpenseType... Refresh VisitMileage.Enabled = cboExpenseType = "Mileage" MileageRate. Enabled = cboExpenseType = "Mileage" VehicleMileage.Enabled = cboExpenseType = "Mileage" Since that will set those fields Enabled/Disabled on EACH subform record, use the same code in the subform record OnCurrent event. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Kurt_Cobain67" wrote in message s.com... Hey, Can any one see if that can help? I want to disable certain fields when a certain value is selected in a combo box. I have a form called "Expenses" and within that a subform "GeneralExpenses_subform". On the subform form when you select a value other than "Mileage" from the combo box "ExpenseType" i want "VisitMileage","VehicleMileage" and "MileageRate" to be disabled so that no data can be written in to them on that particluar record. Cheers Nathan |
#3
|
|||
|
|||
Disable text box via Combo box
Cheers for that.
I have pasted the code in to AfterUpdate on the combo box and on the subform in OnCurrent, but the feilds are disabled all thetime no matter what i select. Nathan |
#4
|
|||
|
|||
Disable text box via Combo box
Please provide the code, exactly as you used it...
I'll test my solution in the meantime... -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Kurt_Cobain67" wrote in message ups.com... Cheers for that. I have pasted the code in to AfterUpdate on the combo box and on the subform in OnCurrent, but the feilds are disabled all thetime no matter what i select. Nathan |
#5
|
|||
|
|||
Disable text box via Combo box
Kurt,
Please don't delete any threads from our previous posts. It's convenvenient to see my, and your, past reponses as we continue the problem determination. Let's try a more obvious method... On the combo AfterUpdate event... (use your own field names... I used my own for ex.) If Service = "Design" Then WorkDescription.Enabled = False Else WorkDescription.Enabled = True End If On the subform On Current event If IsNull(Service) Or Service "Design" Then WorkDescription.Enabled = True Else WorkDescription.Enabled = False End If I tested this, and it works. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Kurt_Cobain67" wrote in message ups.com... Cheers for that. I have pasted the code in to AfterUpdate on the combo box and on the subform in OnCurrent, but the feilds are disabled all thetime no matter what i select. Nathan |
#6
|
|||
|
|||
Disable text box via Combo box
Just happen to notice a typo... that initial code should have been.
VisitMileage.Enabled = cboExpenseType "Mileage" (not equal rather than equal) MileageRate. Enabled = cboExpenseType "Mileage" VehicleMileage.Enabled = cboExpenseType "Mileage" If you still have problems, try my later posted code. I tested that. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Al Campagna" wrote in message ... Kurt, On the AfterUpdate event of cboExpenseType... Refresh VisitMileage.Enabled = cboExpenseType = "Mileage" MileageRate. Enabled = cboExpenseType = "Mileage" VehicleMileage.Enabled = cboExpenseType = "Mileage" Since that will set those fields Enabled/Disabled on EACH subform record, use the same code in the subform record OnCurrent event. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Kurt_Cobain67" wrote in message s.com... Hey, Can any one see if that can help? I want to disable certain fields when a certain value is selected in a combo box. I have a form called "Expenses" and within that a subform "GeneralExpenses_subform". On the subform form when you select a value other than "Mileage" from the combo box "ExpenseType" i want "VisitMileage","VehicleMileage" and "MileageRate" to be disabled so that no data can be written in to them on that particluar record. Cheers Nathan |
#7
|
|||
|
|||
Disable text box via Combo box
Al Campagna wrote: Kurt, Please don't delete any threads from our previous posts. It's convenvenient to see my, and your, past reponses as we continue the problem determination. Let's try a more obvious method... On the combo AfterUpdate event... (use your own field names... I used my own for ex.) If Service = "Design" Then WorkDescription.Enabled = False Else WorkDescription.Enabled = True End If On the subform On Current event If IsNull(Service) Or Service "Design" Then WorkDescription.Enabled = True Else WorkDescription.Enabled = False End If I tested this, and it works. Hey, this works but it enables and disables all of the previous cells in the record, i want it to disabled and enable the cells in each individual record, not the whole table. Cheers Kurt |
#8
|
|||
|
|||
Disable text box via Combo box
Such is the nature of forms.
If you changed the color for one field, all records would have that field color. Any change to a field on a continuous subform or single form is "visibly" applied to all records. But... it's the same for single forms. Disable a field and all rceords have that field disabled... it's just that you don't see the other records in Single like you do in Continuous. Of course, as you move from record to record, the code enables/disables as you get there, so it "appears" as though each record has it's "own" disable/enable. You could use Locking instead, then the "appearance" of the field would not change so obviously. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Kurt_Cobain67" wrote in message ups.com... Al Campagna wrote: Kurt, Please don't delete any threads from our previous posts. It's convenvenient to see my, and your, past reponses as we continue the problem determination. Let's try a more obvious method... On the combo AfterUpdate event... (use your own field names... I used my own for ex.) If Service = "Design" Then WorkDescription.Enabled = False Else WorkDescription.Enabled = True End If On the subform On Current event If IsNull(Service) Or Service "Design" Then WorkDescription.Enabled = True Else WorkDescription.Enabled = False End If I tested this, and it works. Hey, this works but it enables and disables all of the previous cells in the record, i want it to disabled and enable the cells in each individual record, not the whole table. Cheers Kurt |
Thread Tools | |
Display Modes | |
|
|