×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

locate

locate

(OP)
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

RE: locate

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."

RE: locate


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."

RE: locate

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."

RE: locate

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close