Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Saving form erasing data (Read 2812 times)
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Saving form erasing data
Sep 28th, 2006 at 12:36pm
Print Post Print Post  
I have a database application that gets saved under different names so that each one can include separate data for a separate client.  I have been working on the original form, and when I get done, I copy that programming data to Word, then from Word, copy it to the other copies of the database.  Although when I get the programming pasted into the copy database, I reconcile it.  Going in to the same file in Sesame (Not Sesame Designer), some of the programming isn't working like it did in the original database.  For example, my XLookup commands don't lookup any information, and when I save for form, the value I enter to be looked up gets erased.  Angry

I really hope someone can tell me what I am doing wrong, and/or how to fix it.   Wink

Thank You.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #1 - Sep 28th, 2006 at 1:13pm
Print Post Print Post  
If all of these applications are identical, you may be better served using one application and placing a "client" element on the form, and using a query to work on each client in turn.

If all of these applications are identical you can use the "Export All to Text File" and the "Import from Text File" options in the File pulldown menu in the programming editor to export your programming from the master application and import it into each of the copy applications. In any case, do not use MSWord, it is not an ASCII text editor and may be munging your code. It is not made for *any* kind of programming and should not be used for ASCII data. Use a text editor instead of a word processor.

If all of these applications are identical in design, but different in data, you can simply reconcile to the others from the master DSR file, without having to cut and paste any code at all.

Do your XLookups have the filename of the application in them? If so, replace these with @Fn so they will work in any application even if it has a different name.

If you use @XLookup instead of using XLookup, you can return the value to a variable and check its value (and the value of @Error) before you assign the value to an element and overwrite the existing value. If the there is a choice between using a function and a subroutine, that are otherwise identical, always use the function and return the value to a variable.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #2 - Sep 28th, 2006 at 1:37pm
Print Post Print Post  
I agree with The Cow re using a single application and/or single dsr.

I have a customer who also likes to have a separate database for each client, but they are all meant to behave identically. I keep a Master dsr. When I make a programming change, he simply reconciles the Master dsr to each Client db, one at a time.  Each Client db contains a couple of GlobalValues for those few things that are different, such as Client Name, and the programming makes use of those where needed.

It works very nicely.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #3 - Sep 28th, 2006 at 3:12pm
Print Post Print Post  
Thank you both for your quick responce and ideas.  Although I can not reconcile some of the data straight to another database for a few changed cannot be unchanged, but the programming should be the same.  I backed up all my files, exported all programming data to text file.  I opended another database in Designer and deleted all programming.  Saved, and the imported programming from text file.  Saved, and reconciled with the .db file.  When I opened it to try it, I was still getting the same results.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #4 - Sep 28th, 2006 at 3:18pm
Print Post Print Post  
Did you try the other suggestions regarding using @FN or looking for naming differences?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #5 - Sep 28th, 2006 at 4:09pm
Print Post Print Post  
I don't think that @FN applies to my @XLookup s.  I am having something looked up from outside of this application.  That way one application holds the same data for dozens of applications to access.  For Example:

Code
Select All
vlook = @XlookupSourceList("data\worksheet.db",ThisElement, "worksht!work sheet", "DESC1;DESC2;DESC3;DESC4;DESC5;DESC6;DESC7;DESC8;DESC9;DESC10;DESC11;DESC12;DESC13;F0038;F0043;F0048;Procedure")
 


And
Code
Select All
vemp = @XLookup("data\empno.db", ThisElement, "empno!Employee No.", "Employee Name")
 



  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #6 - Sep 28th, 2006 at 4:24pm
Print Post Print Post  
Immediately after your @XLookup, place the following line.

WriteLn(@Error)

After you run this, does the popup window say "yes" or "no"?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #7 - Sep 28th, 2006 at 4:47pm
Print Post Print Post  
That is odd.  The one looking up the worksht database says NO.
The one looking up EmpNo, shows nothing at all. and gets removed on the save.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #8 - Sep 28th, 2006 at 4:51pm
Print Post Print Post  
Are you sure that the one looking up EmpNo is running at all? I'm not sure what "it" gets removed on "the save" but perhaps you have an If condition that is false and preventing the EmpNo lookup?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #9 - Sep 28th, 2006 at 5:16pm
Print Post Print Post  
Code
Select All
var vemp as string

vemp = @XLookup("data\empno.db", ThisElement, "empno!Employee No.", "Employee Name")
writeLn(@Error)
Calibrated by Technician0 = vemp
 



This is the complete code that is in EmpNo Element Programming on Element Change.  I enter in a number for example "53" and it should put "James Jones" in Calibrated by Technician0 textbox.  Nothing happens to Calibrated by Technician0 and when i save record, EmpNo textbox that had "53" in it disappears.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #10 - Sep 28th, 2006 at 5:23pm
Print Post Print Post  
It sounds like the EmpNo element is Unbound. That would cause both the "nothing happens" and the "disappearing value" behavior.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #11 - Sep 28th, 2006 at 5:41pm
Print Post Print Post  
Well that was exactly it.  Now that gives me one more thing to check first.  Thank You.
  
Back to top
 
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #12 - Sep 28th, 2006 at 5:46pm
Print Post Print Post  
Okay.  I replaced the element to be bound to itself.  I saved it to the .db file, and it wasn't bound anymore.    I don't know how it is getting unbound.  Any clues?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Saving form erasing data
Reply #13 - Sep 28th, 2006 at 5:50pm
Print Post Print Post  
Calibrate1 wrote on Sep 28th, 2006 at 5:46pm:
Okay.  I replaced the element to be bound to itself.  I saved it to the .db file, and it wasn't bound anymore.    I don't know how it is getting unbound.  Any clues?



Elements aren't bound to elements. They are bound to a field in the underlying database. The element and the field may have the same name, but they are not the same thing.

In Designer, click the EmpNo element to select it.
On the Property Editor, go to the Other Tab.
From the Bound To dropdown, choose the field name whose data you want to see in the EmpNo element.
Click the Set button next to Bound To.
Check the Other Tab in the Property Viewer to make sure EmpNo is Bound To the correct field.
Save the Layout.
Reconcile to the correct db.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Saving form erasing data
Reply #14 - Sep 29th, 2006 at 12:24pm
Print Post Print Post  
I was able to get "empno" element bound to "!empno".  Saved to the correct db, and it worked perfectly.
This morning I opened the db and the first record that I added wouldn't complete the lookup. Shocked  I saved my records so I could look at the others.  Now all the records I corrected yesterday in the empno field are empty. Cry  How can a text file, without going into designer, can loose what it is bound to?  Thank you for all your patience working this out with me.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print