Running lookup forms with RecordRef variables

I’m sure everybody is familiar with the code… FORM.RUNMODAL(0,LrecCustomer); by specifying zero the defined lookup form for the corresponding rec is run. I want to do something similar with RecordRefs e.g. FORM.RUNMODAL(0,LrrfRecordRef); but this code does not compile as a RecordRef is not a valid parameter for the FORM.RUNMODAL command. Does anybody have any ideas how I can use another method to solve this problem? Thanks in advance. Chris.

If you need to pass a concrete record you can use Record variable as parameter, can’t you?

Arthur, Thanks for your reply. The problem I’m currently working on is a testing tool that catalogues table data changes between two points in time. I’m presenting the user with the complete list of tables in a form based on the “Table Information” table. I don’t know which one they will select so I hope to use the RecordRef variable to save declaring loads of “concrete record” variables. Chris.

So maybe try something like this: RecordRef: RecordRef Form: Form Form.SetRecordRef(recordRef); Form.RUN; SetRecordRef is function that sets passed parameter to some global variable. Got that? Idea - give RecordRef as parameter to form and then run it. Should work.

Hi Arthur, I did not know that you could do that with forms and recordref. I guess learn something new every day [:I] But I do not think it would necessarily solve the original problem. To call SetRecord functions you need a variable pointing to a specific form. The problem with a specific form is that is based on a specific table [:D] So then it would not work for any kind of table. That is why Form.Runmodal(0,…) because it automatically figures out which form to run based on the table. The only way to do that using Form.SetRecordRef would be to create a new table, create a setup to say which fields from any table should go to that table and then fill that table with the right values before calling Form.SetRecordRef and run. [:p] Hope that helps (though probably not [:D]) Cristi Nicola