Re: display logical field as checkbox in a list control
Attached is my dumbed down component and a way-scaled down Access mdb with a table and a query (view). The list control in the component is connected to the view because that view includes a field to use as logical for changing the field PAID_STATUS back and forth between TO PAY and UNPAID. The checkbox shows checked if PAID_STATUS = TO PAY and unchecked if PAID_STATUS = UNPAID. Basically, my users are selecting bills to pay with the check box. They don't see that PAID_STATUS field.
I have gone ahead and included my test button at the top of the component that loops through the list control and gets primary key values for the checked and then for the unchecked checkboxes, then does an ajax callback to an xbasic function that updates the table accordingly. For testing, I have a couple of text boxes on the component to show the primary key values (entry numbers) that the javascript looping captures.
Just as an aside, you will see that I am capturing errors when connecting, or running the sql statements, and then calling a js function that has a nice message box with info about the error and what the user should do. Just as a point of curiosity, you might want to try making the connection or the sql statements fail and check out the message.
CHSTestCheckbox.zip
Attached is my dumbed down component and a way-scaled down Access mdb with a table and a query (view). The list control in the component is connected to the view because that view includes a field to use as logical for changing the field PAID_STATUS back and forth between TO PAY and UNPAID. The checkbox shows checked if PAID_STATUS = TO PAY and unchecked if PAID_STATUS = UNPAID. Basically, my users are selecting bills to pay with the check box. They don't see that PAID_STATUS field.
I have gone ahead and included my test button at the top of the component that loops through the list control and gets primary key values for the checked and then for the unchecked checkboxes, then does an ajax callback to an xbasic function that updates the table accordingly. For testing, I have a couple of text boxes on the component to show the primary key values (entry numbers) that the javascript looping captures.
Just as an aside, you will see that I am capturing errors when connecting, or running the sql statements, and then calling a js function that has a nice message box with info about the error and what the user should do. Just as a point of curiosity, you might want to try making the connection or the sql statements fail and check out the message.
CHSTestCheckbox.zip
Comment