Macro to copy a field from a View Table on Base

I am trying to create a push button on a form to copy a field from a view table depending on the entry,

For example on entry 1 of the form, I want to reference entry 1 on the view table. but I don’t know how to reference the view table or match the entry number from the form to the view table

This is a continuation of a previous question which can be viewed here.

I have included a file as an example of the current DB.

What I want to do is have the format of the field FieldA, FieldB, FieldC and FieldD on the clipboard, as indicated on View1 from the file below.

1532573290790838.odb

@ehesh This question is very vague. The View is based upon information from other table(s). A View can be in any sequence and not necessarily the same as where it originated from. What relation is there for ‘entry 1’ on the form and ‘entry 1’ in the View? Should be a connection. Also you need to be specific as to what is being copied & what you are going to do with it. Why is a View even involved? Is this concerning the concatenated field previously discussed? Need clarity.

yeah, it is regarding the concatenated field previously discussed. I added more details to my question above as well as a modified version of the file you initially provided. I removed the text boxes since they were not really needed if I had them on the View, but I kept the code/formula in order to set up View1. What I need now is to have them on the concatenated field on the clipboard with the push of the button

So you just want the result on the clipboard?

Hello,

Edited version:

Apoligies for not reading your comment close enough. You still don’t need a view.

In my opinion this is in opposition to all I’ve stated before and even further now. Why even create a View when, if you insist on duplicating this information, you can do it right at entry time. Hope you understand that macros are not the easiest thing to comprehend. It takes some time to absorb the details on how to do things. Here is a working sample:

Sample ---- DisplayConcatonatedFields.odb

Modified form FieldTable to be FieldTableWithButton and the push button copies the field to the clipboard using the macro found here → BASIC Macro to Copy textbox value to clipboard. It was only slightly modified to fit the situation.

Since, through experience, I realize the tasks ahead for you, here is the best reference for LO macros. Book written by Andrew Pitonyak (PDF) - Open Office Macros Explained.

BTW The text boxes on the form displaying the concatenated text are not necessary for the macro to work.

After I click the button the field labels disappear. Is that supposed to happen?

No. You have not stated (in any of your questions) what OS & which LO version you are using. This is basic info when asking any question (Base should include more depending on the question). Please provide. Did this happen on the provided sample or on your form? Did the copy to clipboard work for you? Have no problems on Mint 18.3 as you state and copy to clipboard works.

nevermind. if I scroll they come back.