Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox causes skip in master table
Message
From
20/10/1998 11:50:45
 
 
To
20/10/1998 01:38:21
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00148279
Message ID:
00148515
Views:
20
Hi, Rob.

1. Do you mean "BoundTo" ?
4. I don't understand your implementation. What does the combo box do with regards to recycling a deleted record? Do you mean that the cbo shows the deleted records that user can pick to recall?

Notes: don't use PRIVATE variables (generally, and specifically here). Use form properties instead.

The way I use cbos are to pick a value for a field in a table when values are logically or reasonably limited. Sometimes users can add new values to the look up table (combobox style). In this case, in the valid, I check to see if the display value <> value (I use boundto=.t.). If so, then I run a modal form so the user can enter the info they need to put in for the look up table. I use modal so they are sure to get the new item in the list before trying to pick it. Then I refresh the list so they have it available to select from. If the user is not supposed to enter new values in the lookup table (dropdown list), then, well, there is no need for the valid.

I hope I'm not totally off the mark, and that this might help a little bit. Otherwise, you might want to describe what you are trying to accomplish and then we can offer some suggestions for getting there.

>Per your query:
>
>1. Controlsource is linked to the field, but Bound = .F. (default)
>2. Rowsource is drawn from a different (lookup) table - Yes
>3. Rowsource is type 6 - fields - in the other table
>4. Code in methods: I started with none except to re-select the right work area, but currently it looks like this (nAtAdd is a property that is the record number of the newly added record in the master table):
>*********************************************************************************
>* CombocComp_ID - Valid
>DODEFAULT()
>* be sure the desired table is active...
>SELECT wCalForm
>IF .NOT. THISFORM.llEdit && ie: in ADD mode...
> IF BETWEEN ( THISFORM.nAtAdd, 1, RECCOUNT() )
> GOTO THISFORM.nAtAdd
> ENDIF
>ENDIF
>* the following re-sets initial values for the next field (combobox, too...)
>PRIVATE ALL LIKE j*
>jRetVal = .T.
>IF THISFORM.CombocComp_ID.VALUE <> [Z]
> THISFORM.CombocZone.VALUE = [9]
> THISFORM.CombocZone.ENABLED = .F.
> THISFORM.CombocZone.REFRESH
>ELSE
> THISFORM.CombocZone.ENABLED = .T.
>ENDIF
>RETURN (jRetVal)
>********************************************************************************
>* CombocComp_ID - LostFocus
>DODEFAULT()
>* be sure the desired table is active...
>SELECT wCalForm
>IF .NOT. THISFORM.llEdit && ie: in ADD mode...
> IF BETWEEN ( THISFORM.nAtAdd, 1, RECCOUNT() )
> GOTO THISFORM.nAtAdd
> ENDIF
>ENDIF
>ThisForm.Refresh
>********************************************************************************
>5. Add master record before selection from cbo? This application uses Recycled deleted() records, so the answer is Yes.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform