Normal Topic Updating Subforms (Read 1351 times)
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Updating Subforms
Jun 30th, 2006 at 2:10pm
Print Post Print Post  
I have two databases, one for customer records and one for booking records.

In the booking form I have a relational subform displaying the customer information.
When entering new data everything is working fine.
I obviously also want to have the chance to search, retrieve, and display (bind) existing customer data to a new booking. The realtion is via a unique booking number and every customer records has a unique customer number.

I open a serach window from the subform to search the customer database but how do I get a record found to display in the subform?

Thanks for any help.
Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Updating Subforms
Reply #1 - Jun 30th, 2006 at 4:28pm
Print Post Print Post  
Maybe this is what your looking for:

To display records in sub-forms in search mode hit F10 Twice.   Wink
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Updating Subforms
Reply #2 - Jun 30th, 2006 at 4:53pm
Print Post Print Post  
Hello Carsten,

Can a customer be booked more than once? ex. Would the Joe Smoe customer record ever need to appear under more than one booking record?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Updating Subforms
Reply #3 - Jul 1st, 2006 at 2:39pm
Print Post Print Post  
@ray:

Yes, a customer can appear under several different bookings, however only once per booking and only one customer is assigned to a booking.
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Updating Subforms
Reply #4 - Jul 5th, 2006 at 3:52pm
Print Post Print Post  
Hello Carsten,

If a customer can appear under several bookings then linking via the booking number will not work. Each customer can only have one booking number at a time, unless you get tricky.  There are a couple ways to do what you want to do.

The first way, the simple way, is to switch the relational link from the booking number to the customer number. Since only one customer is assigned per booking record, you just enter the customer number on the booking form and it will link in the customer information. If you ever need to book two customers to one booking record, not sure if you would, but you can do that as well with linking by the customer number.

The second way is a little trickier. You would need to turn the Booking Number field in the Customer database into a Keyword field. Then turn the Booking Number field in the Booking Database into a text field. At this point your linking will work like it does now, so you should see the same records. Note: You may need to run a Mass Update to strip the trailing zeros. But this way gives you the ability to link a customer record to any number of booking records, right from the customer form.

Ex: Say you want to add Joe Smoe, who is already booked in the 7206 booking, to the 42104 booking record as well. You would search the Customer Database for the Joe Smoe Record. In the booking number element the record currently has '7206'. You would just add ';42104' to the booking number element. So the final value in the Booking Number element of the Customer form would be '7206;42104'. This means that Joe Smoe would appear under both the 7206 booking and the 42104 booking.


-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Updating Subforms
Reply #5 - Jul 7th, 2006 at 2:07pm
Print Post Print Post  
Hello Ray,

I changed from booking to customer number and it works as long as I use text format for the fields. It is indeed a lot easier then using the booking number. I did get it to work but it was verry tricky. I had to use wildcard search and special delimiters.

Here is what I do:

I open up the serach form on the customer DB from within the subform via a button using SelectTreeItem.
Then I serach for the customer or add a new one.
I then have an accept button which transfers the customer number back onto the booking form using FormFieldValue and the save and exit the form.
When I go back onto (the still open) booking form, I can see that the customer number has been transferred, but the subform has not been update to show the new link to customer X. How can I get the form to update its contents?
When I save and reload the record, then everything is fine and I can see that the connection has been made.

Regards and thanks for your help!
Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Updating Subforms
Reply #6 - Jul 7th, 2006 at 5:54pm
Print Post Print Post  
Hello Carsten,

A parent record will link in it's children when that record is loaded. So what you can do is program the parent form to advance(F10) one record and then move back one record(F9). You can use @SelectTreeItem() to select both of those choices off the Menu Tree.

Quote:
I did get it to work but it was verry tricky. I had to use wildcard search and special delimiters.


What sort of wildcard and delimiters did you have to use?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Updating Subforms
Reply #7 - Jul 13th, 2006 at 12:31pm
Print Post Print Post  
Hello Ray,

I used a preceeding and trailing blank for each number and then did a wildcard search with "..[blank]XXX[Blank].." This was quite tricky but did work fine. I did not even need a separator anymore.

Now back to my updating problem:

I did as you suggested and bound the programming to the cistomer number field "on immidiate change" and also tried on "element change".
The programm will not executed when I return from the search form, even though the customer number has been correctly transferred to the field. It will only run if I enter any of the fields on the form.
What am I doing wrong?
I return to the calling form by calling SelectTreeItem and then exiting the search form.

-Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Updating Subforms
Reply #8 - Jul 13th, 2006 at 5:57pm
Print Post Print Post  
Hello Carsten,

You want the programming to be on the form you are leaving, not on the form you are going to, and in the programming event where you leave the one form and go to the other. The code would be something like.

@SelectTreeItem() back to parent form
@SelectTreeItem() F10
@SelectTreeItem() F9
@Exit

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Updating Subforms
Reply #9 - Jul 14th, 2006 at 8:56am
Print Post Print Post  
Hello Ray,

it is working!!!!   Smiley

Thank you verry much for your help!

-Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged