Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record creation
Message
From
23/07/2008 00:03:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
22/07/2008 23:45:32
Muthu Vel
Sty Company
India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01333372
Message ID:
01333374
Views:
17
>I have a table student.dbf having fileds 1.Regno, 2.name. 3.Standard.
>
>I have create a record creatrion.scx, In that I have placed two text boxes namely From, To and one command button namely OK.
>
>I have create 500 records based on the Regno field. the starting Regno is "10001".so I have entered 10001 to "from" text boxes and
>10500 to "To" text boxes and click OK command button the 500 records have created, the Message box will dispaly Record created Successfully.
>
>How to create records through coding In VisualFoxpro?

You want to create records through code, right?

Something like this, assuming you get the range (from, to) from TextBoxes in the Form.:
* The following code goes into Button.Click()
lnFrom = ThisForm.TxtFrom.Value
lnTo = ThisForm.TxtTo.Value
* Do some checking, for example, lnTo >= lnFrom, or check that the records don't already exist
local lnCounter
for lnCounter = lnFrom to lnTo
  append blank
  replace RegNo with lnCounter
next
* Show results with MessageBox() or with the "wait window ... nowait" command.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform