Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate not working right
Message
 
À
19/06/2002 16:22:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00669297
Message ID:
00670297
Vues:
20
Thank you for clarifying that, I really appreciated your help.

Thank You
Nick Patel


>It's not LOCATE and integers which appears to be the issue, it's the = .F. or !lv_veh_assign.a_uniqueid which is the issue. Neither command snippet will work if lv_veh_assign.a_uniqueid is integer.
>
>>Thanks for answering back. Does SEEK command like integers?
>>
>>thanks
>>Nick Patel
>>
>>
>>>Nick,
>>>
>>>Neither LOCATE command could work right if a_uniqueis an integer! This could be the real issue.
>>>
>>>>Thnaks for answering, I tried it and I got data type mismatch. It is an integer I am locating by.
>>>>
>>>>thanks
>>>>Nick patel
>>>>
>>>>
>>>>>Hi Nick,
>>>>>
>>>>>Jim is on the right track - there is a known issue with LOCATE in a WITH...ENDWITH. Try this,
>>>>>
>>>>>Replace:
>>>>>
>>>>>
LOCATE FOR lv_veh_assign.a_uniqueid = .f.
>>>>>
>>>>>With:
>>>>>
>>>>>
LOCATE FOR !lv_veh_assign.a_uniqueid
>>>>>
>>>>>
>>>>>>I have a pageframe that contains 3 different views. On one of the pageframes I have a add button that allows the user to go to different form and add new vehicle assignment info. After the person adds the info it returns back to pageframe. On the pageframe I want to locate the last record I just added on another form. The view that I am using is lv_veh_assign. The view consists of a unique field call lv_veh_assign.uniqueid (.f), and another field that holds the master record id called a_id (.a) and other vehicle assignment fields. I am using the locate button to find the last record added from an area. I have the correct record in the array, but when I go to located it, I get a dialog box wanting me to locate the table. I do have the view in my data enviroment (lv_veh, lv_ser, lv_veh_assign) and my other pageframes use other views. When I am doing a locate I am explictly ask it to locate the record from lv_veh_assign view, why am I get the OPEN dialog box to locate table?
>>>>The
>>>>>>following is the add button code.
>>>>>>
>>>>>>
>>>>>>
>>>>>>WITH thisform
>>>>>>	hrecno = RECNO()
>>>>>>	.visible = .f.
>>>>>>	DO FORM add_assign WITH  .a  && .a is master rec id
>>>>>>	.visible = .t.
>>>>>>	lc_id = .a
>>>>>>	REQUERY('lv_veh_assign')
>>>>>>	lvassign = RECCOUNT('lv_veh_assign')
>>>>>>	IF lvassign > 0
>>>>>>		SELECT MAX(lv_veh_assign.a_uniqueid) FROM lv_veh_assign ;
>>>>>>			WHERE lv_veh_assign.a_id = .a INTO array a__gen12
>>>>>>		.f = a__gen12(1,1) && .f is the uniqueid for lv_veh_assign
>>>>>>		LOCATE FOR lv_veh_assign.a_uniqueid = .f.
>>>>>>		RELEASE a__gen12
>>>>>>		.f = lv_veh_assign.a_uniqueid
>>>>>>		.pf1.p3.cmddelassign.visible = .t.				
>>>>>>		.pf1.p3.refresh()
>>>>>>	ELSE
>>>>>>		.pf1.p3.cmddelassign.visible = .f.
>>>>>>	ENDIF
>>>>>>endwith
>>>>>>
>>>>>>
>>>>>>thanks
>>>>>>Nick Patel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform