![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Frank Use a Tcursor to inspect the underlying table. You can then change the properties as needed Chuck |
#5
| |||
| |||
|
|
Actually I think you will need to put it in the new value or change value of the key field on form 1 since you will want to know if there are child records not just for the first record in the table but for each as you scroll. Using a tc all you will have to do is setrange the tc and test for Nrecords = 0. Denn Santoro President Resource Development Associates http://www.RDAWorldWide.Com Offices in the United States and Germany Providing solutions to health care, business, governments and non-profits since 1982 |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Right now I'm just trying to get the button to change color. It hasn't yet. |
#8
| |||
| |||
|
#9
| |||||||
| |||||||
|
| Try it in the new value and see what happens when you scroll |
| Also be sure the fields are contained in a record object, not just bare |
| Also, you don't need the range to have the value twice for a single value |
| Not sure why you are using an anytype for the key value. Try using the same |
| Finally, get in the habit of using a naming convention that makes very clear |
| Also, if you are just a beginner here I'd suggest you check out my Database |
|
Pretty close. Try it in the new value and see what happens when you scroll. Also be sure the fields are contained in a record object, not just bare fields on a form. Also, you don't need the range to have the value twice for a single value setrange. A single value on the key is treated as exact match. Not sure why you are using an anytype for the key value. Try using the same type as the field (hopefully long int). Finally, get in the habit of using a naming convention that makes very clear what all your variables are by type. See the faq on naming conventions for a good one. Also, if you are just a beginner here I'd suggest you check out my Database Basics paper to help learn some best practices and common pitfalls. You can get it on our Paradox resources page (link in my signature) Denn Santoro President Resource Development Associates http://www.RDAWorldWide.Com Offices in the United States and Germany Providing solutions to health care, business, governments and non-profits since 1982 |
#10
| |||||
| |||||
|
|
Hi Dennis, Sorry for the delayed response. Try it in the new value and see what happens when you scroll Tried it... pButLocations.color won't change |
| Also be sure the fields are contained in a record object, not just bare fields on a form I hope I'm understanding you correctly. I'm assuming "the fields" you are speaking of... is the "one" field... with the changeValue(or newValue) code attached to it (and not the fields in the table that the tCursor is attached to). |
|
If that's the case then... no can do. The appID.field (the primary key field for the main table attached to Form1) has to sit "bare" on Form1 to accomodate all the other required fields needed for data entry. A table object would require a horizontal scroll bar a mile long. |
| Also, you don't need the range to have the value twice for a single value setrange. A single value on the key is treated as exact match. Done Not sure why you are using an anytype for the key value. Try using the same type as the field (hopefully long int). smallInt... done Finally, get in the habit of using a naming convention that makes very clear what all your variables are by type. See the faq on naming conventions for a good one. THANX... I checked it out. Also, if you are just a beginner here I'd suggest you check out my Database Basics paper to help learn some best practices and common pitfalls. You can get it on our Paradox resources page (link in my signature) Coooooool doc. Basically, I do follow most all your suggestions. Always generated my own keys (never have used the autoExcrement field type since I accomodate creating keys over a network) but, over the years, I have wimpped out on a few of my table disciplines (a couple use PDox's Ref Integrity, a couple have 10-12 character filenanmes). Other than that it's getting my naming conventions in shape. Since I have no desire to write for others I really don't need portability strategies. So... here's where I'm at. The button still doesn't change color. Code is attached to the appID.field sitting "bare" on Form1 ========================== method newValue(var eventInfo Event) var tcLocations tCursor siCurrentRec smallInt endVar ;|| assign current rec's field.value to variable siCurrentRec = appID.value ;|| open tcLocations if not tcLocations.open(":fcc:iLocation.db") then errorShow("Could not open the iLocation.db table") return endIf ;|| setRange based on current record tcLocations.setRange(siCurrentRec) |
| ;|| color button dependant on if child recs exist if tcLocations.Nrecords() <> 0 then pButLocations.color = red else pButLocations.color = gray endIf |
![]() |
| Thread Tools | |
| Display Modes | |
| |