Populating tables

Discussion of HanDBase running on Windows Mobile Classic and Professional (formerly Pocket PC) devices and smartphones and syncing with a desktop computer.

Populating tables

Postby Totte » Thu Aug 16, 2012 3:29 am

Hi

I have HTC HD2 Mobile 6.5

I need some help with populating tables.

This is how it looks:

Tables: Sites, Surveys, CheckList, ChkList

Sites is related to Surveys
Surveys is related to CheckList

ChkList is "template" table containing questions for the inspector to give answer to.

Table CheckList is from start empty.
I have managed to populate it with popup from table ChkList, one record at the time.
This method is not effective.

I would like to transfer all records from ChkList to CheckList and get the relation to Surveys set on every record.

Is this possible ?

// Torsten Andersson
Totte
 
Posts: 18
Joined: Tue May 24, 2011 2:05 am
Location: Sweden

Re: Populating tables

Postby Brian_Houghton » Mon Aug 20, 2012 10:30 pm

Hi,

Thanks for posting. You can use the DB Popup field in several instances to pull multiple values from the lookup table. To do this, start by making sure you have all of the fields added to the database that will serve as your lookup table. Then add DB Popup fields to your parent database - one for each item you wish to pull. When doing so, make certain that you select the lookup database/table and choose the fields you want to pull from.

The next part is important, as it joins all fields causing the values from multiple fields all at once. Assign each DB Popup field with the same group number, which must be something other than 0.

Hope this helps.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Populating tables

Postby Totte » Tue Aug 21, 2012 1:36 am

Hi
I think You misunderstood my question.
I already use this teknik You described.
The problem with this is that it pulls one record each time.

I want to pull all records from table c to table b with one operation
and at the same time have the relation set to table a for these.

// Torsten Andersson
Totte
 
Posts: 18
Joined: Tue May 24, 2011 2:05 am
Location: Sweden

Re: Populating tables

Postby Brian_Houghton » Tue Aug 21, 2012 6:08 am

Should you want to move/copy all of your records from one database to another, the only option is to use the "copy records" option in the menu. Note that in order to do this, the field names and types in both databases have to be the same. Using this method, your relationships will be retained.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Populating tables

Postby Totte » Fri Aug 24, 2012 2:40 am

OK

I have problem with this method because in the table I copy from
the relation is not set due to the fact that it is a template table
to be used in every new servey the inspector does.

// Torsten Andersson
Totte
 
Posts: 18
Joined: Tue May 24, 2011 2:05 am
Location: Sweden

Re: Populating tables

Postby Brian_Houghton » Sat Aug 25, 2012 9:40 am

You would want to configure the relationship field prior to copying the records to the template, and you would want to make sure that each of your users have a copy of the related database. I'm assuming the related database is a static file that isn't changing, right? If so, once you have the field in the template configured to point to it, copying the records from one database to the template should work with no problem. The nice thing about relationship fields is that you don't have to go through and manually enter them. The relationship field, when activated, takes the text in the field, goes to the related database, and looks for matches in the specified field. It is in working this way that you can copy in knowing that your relationships will still work so long as the user has a copy of the related table.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Populating tables

Postby Totte » Wed Aug 29, 2012 12:33 am

Hi Brian

The template table can not have any relation prior to copy.

Is there any method to set the relation to parent record for all copied records after or under copy procedure
e.g. get the related field value in parent record to the related field in child table for all records copied to child table ?

I hope You understand.

//Torsten Andersson
Totte
 
Posts: 18
Joined: Tue May 24, 2011 2:05 am
Location: Sweden

Re: Populating tables

Postby Brian_Houghton » Thu Aug 30, 2012 5:49 am

You can safely add the the relationship field after the records are copied. Since the relationship field is based on a sophisticated search, this will work. Please try it out with a sample database to see how it should meet your needs.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Populating tables

Postby dhaupert » Thu Aug 30, 2012 6:23 am

I'm not sure I understand what is being asked- but the field types are checked for the copy, so you just have to have the fields match in source and destination- they do not have to point to the same related table, just be the same types.
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Populating tables

Postby Totte » Wed Sep 05, 2012 6:45 am

Hi again

Sorry for the poor explanation of my problem.
I will now take it from scratch.

I have three tables.

Suveys
Checklist
tmpl_checklist

Checklist is linked to Surveys

Surveys contains my surveys.
Checklist contains the questions that shall be answered for each servey.
tmpl_checklist contains a set of questions and is not linked to any table.

Now, first I create a new record in Serveys.

From the Serveys form I go to Checklist form via a button.

Checklist is at this moment showing no records for my new servey.
I create a new record in Checklist and populate the fields via a DBpopup from first record in tmpl_checklist.
I create a new record in Checklist and populate the fields via a DBpopup from second record in tmpl_checklist and so on.

This works but due to the number of records in tmpl_checklist this is not a conveniently method.

To save time, for every servey I work with, I would like to copy all the records from tmpl_checklist to Checklist with one single command.

As far as I know the linked field will only be set when you create new records, not when you copy.

Is there a workaround.

//Torsten Andersson
Totte
 
Posts: 18
Joined: Tue May 24, 2011 2:05 am
Location: Sweden

Next

Return to HanDBase for Windows Mobile Classic and Professional

Who is online

Users browsing this forum: No registered users and 1 guest