Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

locate

Status
Not open for further replies.

Lewy

Technical User
Nov 16, 2001
170
GB
I am sure this is something simple, I have a form with 2 table frames on it. The main tableframe is my current stock and the other shows last years stock. The tables are not linked nor are they keyed. I wish to synchronize the 2 tables so that I can read the value of a product from last year. Presently I can copy the field value manually, click in the field of the 2nd table press ctrlZ, ctrlV and locate the product. I can then maunally enter the values accordingly. I have tried to automate this using the following code in the doubleclick event on the part number field in the main tableframe but I cannot get the locate to work.

var

Frame uiobject
PartRef string

endvar

Frame.attach(OldStock);Name of 2nd tableframe
PartRef =self.value
Frame.moveto()
view(PartRef);check that variable has been assigned
Locatepattern("PartNO",PartRef);**doesn't locate variable**
CurrentStock.moveto(); name of main tableframe
 
Have you tried frame.locatepattern("PartNO",PartRef)

??

I don't think you need to moveto frame, if you use the uiobject in the locate.

You might even try
; in case the frame object can't
; be seen from the object containing
; the code
if not Frame.attach(OldStock) then errorshow() return endif
frame.locatepattern("PartNO",self.value)

Does the value have alpha characters? You might try ignorecasseinlocates(yes) prior to starting this.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 

What I would try:

open a tcursor to the underlying (2nd) table in the page arrive/open. Then no need to do it every time you doubleclick.

In doubleclick or wherever,
dodefault ; make sure you are on the field
tc.locate("PartNO",self.value)
; tc.locatepattern(Frame.attach(OldStock)
Frame.resync(tc)


Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
tc.locatepattern("PartNO",self.value)

WHY is there no EDIT here?!?!

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
Thanks Tony,

Just adding the Frame.locatepattern worked. I thought it would be something very simple - sometimes I can't see the wood for the trees!

Regards,

Lewy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top