Jump to content

Searching one database from another by an related field


This topic is 7270 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have a user information database and I want to set up a button activated script so that I can access all the records in a repair log database. Both databases have a field named user and I have a relationship between the two fields established. In the user info database I have a script written to open the repair log database and execute a script that searches that database for all instances of the particular user that was in the field on the user info database. When I press the button on the user info database it opens the repair log database but acts as thought there is no find criteria. I'm using filemaker pro 4.1. I'm sure its something very simple but since I'm somewhat new to FMP I'm at a loss of where to go next. Any suggestions would be great.

Heres the scripts.

****From User Info

Open["maintenece log.fp3"]

Perform Script[External:"maintenence log"]

Exit Script

****From search maintenence log script

Enter find Mode []

Perform Find[]

Set Field["User", "Exact(User, User Info::User Name) or User Info:??? User Name = User")

Find All

Exit script

crazy.gif" border="0

Link to comment
Share on other sites

Okay, firstly... there is no need to put exit script at the end of each script, fm automaticly exits the script when it gets to the last line of the script. Exit script is used to quit a script early if a condition is not met.

Now, why such a complicated set field? Surely you could just put:

Set field ["User","User Info::User Name"]

And you need to set your field before you perform the find. At the moment you've got it before you set the field, which is why it can't find the search crieria.

I don't think you need that find all either, that will find all the records in your database and you'll lose what you just found in your search.

Hope I have helped. If it still doesn't work after you make these changes, what does your relationship consist of?

Cat smile.gif" border="0

Link to comment
Share on other sites

  • 2 weeks later...

italian_at_work,

Both databases have a field named user and I have a relationship between the two fields established.

From the master file, you could use a one line script:

Go to Related Record [show]

You could also follow this step by call to an external script in the related file that does things like switch to the proper layout, maximise the window, etc.

Tom England,

There are a couple of ways do to this. Make sure the relationship allows creation of new records. Create a portal with this relationship. To create a new related record, go to the end of the portal and enter some info. The record will be created automatically.

You can also do it without a portal, but it requires an additional dummy relationship and some extra fields.

Link to comment
Share on other sites

This topic is 7270 days old. Please don't post here. Open a new topic instead.

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
 Share

×
×
  • Create New...

Important Information

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