Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add records
Message
 
To
25/04/2006 09:35:05
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01116225
Message ID:
01116345
Views:
17
Definately :-)

>>Great, IF table has an order by No :-)
>
>If it doesn't it should.
>
>>
>>>>Yes, I didn't saw it :o(
>>>
>>>How about this?
>>>
>>>
>>>USE SERV order tag no
>>>IF EOF()
>>>   M.F  = 1
>>>   M.LE = THISFORM.TEXT1.VALUE
>>>ELSE
>>>   GO BOTTOM
>>>   M.F  = SERV.NO
>>>   M.LE = THISFORM.TEXT1.VALUE + m.F
>>>ENDIF
>>>FOR I=M.F TO M.LE
>>>    INSERT INTO Serv (No) VALUES (i)
>>>NEXT
>>>
>>>
>>>>
>>>>>I think the GO BOTTOM is completely unnecessary in Mohammed's original code and in yours.
>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>>USE SERV
>>>>>>>>SELECT MAX(No) FROM SERV INTO ARRAY laMaxNo
>>>>>>>>IF ISNULL(laMaxNo[1])
>>>>>>>>   M.F  = 1
>>>>>>>>   M.LE = THISFORM.TEXT1.VALUE
>>>>>>>>ELSE
>>>>>>>>   GO BOTTOM
>>>>>>>>   M.F  = laMaxNo[1] + 1
>>>>>>>>   M.LE = THISFORM.TEXT1.VALUE + laMaxNo[1]
>>>>>>>>ENDIF
>>>>>>>>FOR I=M.F TO M.LE
>>>>>>>>    INSERT INTO Serv (No) VALUES (i)
>>>>>>>>NEXT
>>>>>>>>
>>>>>>>>
>>>>>>>>>hi,
>>>>>>>>>thank you at the first time if i nsert number 3 at mytext i see 3 records at my table
>>>>>>>>>as
>>>>>>>>>
>>>>>>>>>1
>>>>>>>>>2
>>>>>>>>>3
>>>>>>>>>if i run the form again and insert new number at mytextbox as 4
>>>>>>>>>i see
>>>>>>>>>1
>>>>>>>>>2
>>>>>>>>>3  &&
>>>>>>>>>3  && repate this number only if table count is 0
>>>>>>>>>4
>>>>>>>>>5
>>>>>>>>>6
>>>>>>>>>7
>>>>>>>>>
>>>>>>>>>thanks
>>>>>>>>>>>hi all,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>i need help to fix this code under to add new record as what i put at textbox.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>USE SERV
>>>>>>>>>>>COUNT TO M.L
>>>>>>>>>>>IF M.L=0
>>>>>>>>>>>    M.F=M.L+1
>>>>>>>>>>>    M.LE=M.F+THISFORM.TEXT1.VALUE-1
>>>>>>>>>>>ELSE
>>>>>>>>>>>   GO BOTTOM
>>>>>>>>>>>   M.F=M.L
>>>>>>>>>>>   M.LE=THISFORM.TEXT1.VALUE+M.L
>>>>>>>>>>>ENDIF
>>>>>>>>>>>FOR I=M.F TO M.LE
>>>>>>>>>>>   APPEND BLANK
>>>>>>>>>>>   REPLACE NO WITH I
>>>>>>>>>>>
>>>>>>>>>>>NEXT
>>>>>>>>>>>
>>>>>>>>>>>thanks
>>>>>>>>>>
>>>>>>>>>>What happens with this code?
>>>>>>>>>>It seems good for me.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform