Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't edit a text box when file is at EOF().
Message
From
14/07/1998 11:23:01
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00117164
Message ID:
00117173
Views:
22
Hi John,

>I have a form with 5 related tables. Several of them are simple lookup tables and are not used in every master record. When I bring up a record for edit and a text box control source table is at eof() becuase there was never an entry made I cannot enter that text box. I assume it is becase the table is at eof(). How can I have the user get into that text box and enter data. I am using Optimistic Table Buffering.

You cannot edit a Textbox with a ControlSource that maps to a field in an empty table. If you do not want to include Add/Edit et al. buttons like others have suggested here, then a simpler solution might be to detect the EOF() and 0 records and automatically pop in a blank record to the table. Here is some example code for Init method of such a form:
*** Form.Init
SELECT table
INSERT INTO table (field,field2) VALUES (value,value2)
THIS.Refresh()
You could use APPEND BLANK instead of INSERT if there are no primary or candidate keys.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform