Selecting single record in a form

This is probably a simple question, but how can I select a single record from a form? I have tried the following procedure, but it doesn’t select anything and goes to the first record in the database.

field «entry»
«entry» = clipboard()
select «entry» = clipboard()

What am I doing wrong?

Thanks for your help

Your code worked for me if entry was a text field, but failed if it was numeric. Regardless of the datatype of the field, the clipboard always contains text. This is how I would do it.

let thisRecord = info("serverrecordid")
select thisRecord = info("serverrecordid")

In Panorama X, info(“serverrecordid”) can be used with both single user, and server databases. It returns a number that is unique to each record in that database.

Thanks. That’s my problem «entry» is a numeric field. I’ll have to convert the data from numeric to text to use in this. Thanks for your procedure suggestion. I’ll try that as well.

Or you could just use a variable instead of the clipboard.

let thisRecord = entry
select thisRecord = entry

You generally want to reserve the clipboard for situations where the user will be involved at one end or the other, either copy or paste. It’s really not an appropriate use of the clipboard to use it as an intermediate value in a procedure.

Got it! Thanks. Perhaps you can help me on another issue. In Pan6 you could save a custom form as text. I know that in PanX you need to use the Export Custom pull-down menu. Is there a way to ‘automate’ that? Or do I have to actually use the pull-down menu, pull down the template I’ve created and then export the data that way?

To automate it, create a procedure and turn on the recorder. Then open the Text Export wizard, choose the template and export. Finally, go back to the procedure and turn off the recorder. You’ll have a recording with the code needed to do the export.

Great. Thanks for the tip.