Jump to content
Sign in to follow this  

Adding records from one DB to another

Recommended Posts

I'll try and keep it brief.

I have a 'Database' and a button on that database that once clicked then writes a record in another database named 'Reports'. So far i've managed the script to take the name and email address fields and the title of the button in question being clicked and write the info into a new record in the 'Reports' database.

This all works and launches the 'Reports' database and then puts a cursor into a 'Comments' field in the 'Report' database to add a couple of lines of text pertaining to that record entry.

Issue 1:

After i've entered the couple of lines of text into the 'Comments' box i want to hit the continue button on the script to confirm i'm finished and then have it switch to the 'Database' window. For literally a flash of a second it does and the switches back to the 'Reports' window.

Issue 2:

I want the text i've entered into the 'Comments' to then post into the 'Database' in the relevant/active record but i've been unable to achieve this and i would love some suggestions as to how i can achieve it.

Share this post

Link to post
Share on other sites

Welcome to the forums!

Don't feel that you need to simplify your questions or keep it brief. The more info that you provide, the better the responses will be.

Do you have one FM file with two tables? What are the table names?

If you have a parent record and you wish to create child records, you'd write a script and assign the script to a button. The script would capture the parent's primary key into a variable, go to a child layout, new record, set the foreign parent key to the $var.

By doing this, you've related the two records.

In your case, you might like to use a popup window and pause, so that the user can enter a comment. Then the user clicks Cancel or Done. The window to the child record closes.

See Demo


Share this post

Link to post
Share on other sites

That's exactly what i'm trying to achieve. I'm using to separate DBs and don't have the first clue where to start in achieving this.

I see that yours launches a new window but you only have one Database - i'm presuming this is because you have two Tables defined?

I have a second database as it is acting as a reporting system.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

By using this site, you agree to our Terms of Use.