Relationship Field

For HanDBase related topics that are not specific to one platform.

Relationship Field

Postby zooguy1492 » Wed Aug 26, 2009 6:41 pm

I have a main database which uses a relationship field to link this database to a second database. When viewing a recording in the second database, how do I show in a form a field in the parent database.

I tried adding another relationship field (this in the second database) which uses the same fields as in the first. Is this the way it is supposed to be done. When I tried to do this on my handheld, I was unable to set the "Other Field" field of the relationship since my field in the main database wasn't shown. However, if I use the Desktop, I'm able to see the desired field for this "Other Field" value.

When I do this, I sometimes am getting the proper value for this field. I seem to get the correct value more frequently on the Windows Mobile application but on the Desktop it is only displayed correctly about 2% of the time. For the rest, it is blank.

Paul P.
zooguy1492
 
Posts: 48
Joined: Thu May 21, 2009 9:18 pm

Re: Relationship Field

Postby dhaupert » Wed Aug 26, 2009 9:11 pm

zooguy1492 wrote:I have a main database which uses a relationship field to link this database to a second database. When viewing a recording in the second database, how do I show in a form a field in the parent database.

I tried adding another relationship field (this in the second database) which uses the same fields as in the first. Is this the way it is supposed to be done. When I tried to do this on my handheld, I was unable to set the "Other Field" field of the relationship since my field in the main database wasn't shown. However, if I use the Desktop, I'm able to see the desired field for this "Other Field" value.

When I do this, I sometimes am getting the proper value for this field. I seem to get the correct value more frequently on the Windows Mobile application but on the Desktop it is only displayed correctly about 2% of the time. For the rest, it is blank.

Paul P.


Sorry for my lack of understanding, but I'm not quite getting what you have set up. If you'd like to either clarify and provide more concrete details or email me the database and forms I'd be happy to take a look for you!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Relationship Field

Postby zooguy1492 » Wed Aug 26, 2009 9:40 pm

Main Database:
Name Field (text)
Link field (Link)
ID Field (Condition field) with "If Link is equal 0 Output Link else Output Link"
Relationship (Relationship) with "Field in this database" set to "ID Field", Other database set to "Secondary Database", "Other Field" set to "Other ID Field".

Secondary Database:
Other ID Field (text)
Description Field (text)
Some additional field

This now "links" the Main Database with the secondary database. In the form for the Main Database, I select the "relationship" button which takes me to a List View of all records in the Secondary Database which matched the "ID field" of the Main Database. While displaying a record in the Secondary database, I want to display the "Name" field from the Main Database.

Hope this is a better description of what I'm trying to do..

In terms of getting you a copy of my database, I hate to say this but you already have it. In that database, when viewing a record in the "ZooSecondaryPWP" database using a form, I want to display the Description field in the ZooMainPWP database.

If what I've explained on what I tried didn't make sense, I can give that another try.

Paul P.
zooguy1492
 
Posts: 48
Joined: Thu May 21, 2009 9:18 pm

Re: Relationship Field

Postby dhaupert » Thu Aug 27, 2009 11:07 am

Hi Paul,

It seems like you are jumping through an awful lot of hoops to NOT use the link/linked pair. If your database instead did this:

Main Database:
Name Field (text)
Link field (Link) tied to to OtherID field in Secondary database
Description: (Relationship) field tying link from this db and linked from other database together and showing the description field as it's value.

Secondary Database:
Other ID Field (linked) pointing to 'Link field' in the Main database
Description Field (text)

You could do everything you'd need as it's designed and with a lot less headaches! If there was some reason you did not want to use linked fields, please remind me. My apologies if I'm forgetting the older part of this conversation- I email with so many customers each day that I can't often keep all the stories straight unless they are all in a single thread!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Relationship Field

Postby zooguy1492 » Fri Aug 28, 2009 8:05 pm

I'm using the relationship field because I would like to eventually interface to MS Access (once I work out other issues).

With that said, even if I use your database format, I'm still not clear when viewing a Secondary database record how I would display the "name" field in the main database?

Paul P.
zooguy1492
 
Posts: 48
Joined: Thu May 21, 2009 9:18 pm


Return to HanDBase General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest