Microsoft KB Archive/128540

{| = BUG: Check Box from Shared Table Appears as Disabled =
 * width="100%"|

ID: Q128540

2.50 2.50a 2.50b 2.60 2.60a WINDOWS kbtool kbbuglist

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a

SYMPTOMS
When a check box variable is based on a table field instead of a memory variable, the check box initially appears as disabled if the table is opened as SHARED.

CAUSE
The check box @...GET is executed before the record is locked.

WORKAROUND
Use either of the following workarounds to enable any check box:

 Execute =RLOCK in the screen setup code. If the table is opened by the screen with the Open Files generated code option or opened in the screen setup code, the =RLOCK must follow the opening of the table. -or- Issue either a SHOW GETS or SHOW GETS command for each check box field in the On Window Activate code.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Steps to Reproduce Problem
1. Create a table called CHKTEST.DBF with a character field named char1 and

a logical field named log1. Add a few records. 2. Create a screen from this table and place a field from char1 and a check box from log1 (these should be from the fields, not memory variables). The check box should not be the first object. 3. Generate the screen and name it CHKTEST.SCX. 4. Close CHKTEST.DBF then run the USE CHKTEST.DBF SHARED command.

5. Issue the DO CHKTEST.SPR command.

6. The check box is disabled. You can't click it with the mouse, but

it will behave correctly after you move to it by pressing the TAB key.

General Notes

 * The check box @...GET is executed prior to the locking of the record when the READ is issued. The record will be locked when the READ is issued unless READ NOLOCK has been specified as a Generated Code Option.
 * Issuing a =RLOCK command prior to the check box @...GET being executed will lock the record and allow the check box to be properly accessed. This must occur after the table has been opened -- not in #SECTION1 of the Setup snippet.
 * Issuing a SHOW GETS or more specifically a SHOW GET for each check box field will suffice. Placing this code into the On Window Activate snippet will cause the check box to be enabled upon running the screen.
 * If the table is opened as EXCLUSIVE, or the check box is the first object on the screen, the check box will always appear enabled.

Additional reference words: FoxWin buglist2.50 buglist2.50a buglist2.50b buglist2.60 buglist2.60a 2.50 2.50a 2.50b 2.60 2.60a KBCategory: kbtool kbbuglist KBSubcategory: FxtoolSbuilder Keywords         : FxtoolSbuilder kbbuglist Version          : 2.50 2.50a 2.50b 2.60 2.60a Platform         : WINDOWS
 * }