Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

property not found?

Status
Not open for further replies.

Samalia

Technical User
Jun 7, 2005
46
CA
I'm trying to write some code that will make it so that when the user clicks on one checkbox, that the other can't be selected as well, and if the user then tries to select the other one, the first checkbox gets unselected. This is the code I'm using, and foxpro, during runtime, tells me that it can't find the property chkBillable, which is the name of one of the checkboxes.

if this.chkBillable = .f.
this.chkWarrantyWork = .t.
if this.chkBillable = .t.
this.chkWarrantyWork = .f.
endif
endif

Samalia
thisform.refresh()
 
Where is this code? located.

if it is in the form,then:
Code:
if this.chkBillable.value = .f.
if it is in the interactive change:
Code:
if this.value = .f.


Ali Koumaiha
Wireless Toyz
Farmington Hills, Michigan
 
Where in the form should it go? If put it in the init i can select both at the same time.
 
Fist, like Ali said, the reason you're getting the error is because you need to add .Value to the statement so that Fox knows what property of the class you're talking about:
if this.chkBillable.Value = .f.

Now if you aren't going to use an option group, you will need to duplicate the code in one of the events such as Interactive Change or Valid, which when the user selects one check box, will toggle the others. You can use a form method for the work, but the code call to the method will have to be somewhere where each of the checkboxes will call it.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top