macro - find record based on text entry

Hi All,

I have a form with a simple text document, what I'm hoping to do is take
the text to open another form and for it to automatically be at the
record that matches the text. If the value does not exist, I want the
entry to be added to the related table.

Help appreciated.

Best,
Joel

Hi Joel,

I have a form with a simple text document, what I'm hoping to do is take

Is the text in question free-standing, as in, in a paragraph outside of
a form control, or is it the value of a form control ?

the text to open another form and for it to automatically be at the
record that matches the text. If the value does not exist, I want the
entry to be added to the related table.

So, if I've understood correctly, you want to use that text string as an
input value for a filter or a query that will pull up the corresponding
record in the second form ?

Just trying to get things clear in my head.

Alex

Hi Alex,

Hi Joel,

I have a form with a simple text document, what I'm hoping to do is take

Is the text in question free-standing, as in, in a paragraph outside of
a form control, or is it the value of a form control ?

Currently I just have a form with a text box with a button next to it
that says "add." I want the add button to run the macro that takes the
value from the text box, first searches a table and if found, opens
another form to that record, else, I want it to insert a new value into
the corresponding table, and then of course open a different form so I
can insert all of the required fields.

the text to open another form and for it to automatically be at the
record that matches the text. If the value does not exist, I want the
entry to be added to the related table.

So, if I've understood correctly, you want to use that text string as an
input value for a filter or a query that will pull up the corresponding
record in the second form ?

Spot on :slight_smile: Sorry for not being clear in the last go.

If needed I can give more details, just ask and I will do so :slight_smile:

Best,
Joel

https://forum.openoffice.org/en/forum/viewtopic.php?f=100&t=42845