Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Update

Status
Not open for further replies.

rclarke

Technical User
May 14, 2001
78
GB
Hello one and all

As you can guess I am stuck once again

I have created a form addorganisation

this consists of the organisation table fields and a grid with the contacts fields in it

I fill in the details of the orgnisation then if I wish to add a contact for that organisation I have an add button

This bit all works swimmingly until I click on my exit button.

At first I thought all was working well I went into the organisations table the organisation was there I went into the contacts table the contacts were there. BUT if I closed down the database and reopened it they would disapear. The data was not commiting its self to the table so I put =TABLEUPDATE(.T.) in the exit button.

Now I have the problem that if I don't add a contact it updates the organisation table fine but if I add a contact it update the contact table and not the organisation table.

Please help

I presume I have to declair something else in the table update command but when I try it throws up errors such as variable organisations if not found.

Luv

Rachel
 
hi rclarke,

Can't say much about by stydying this only. But still what i think is, you have to use TABLEUPDATE(.T.) two times, one for each table some like this.
SELECT TABLE1
=TABLEUPDATE(.T.)
SELECT TABLE2
=TABLEUPDATE(.T.)

I hope this will solve your problem, if already you are not doing this.
 
I suggest the best way is to do the table update at the place where you do the saving after the adding or editing. If that is SAVE button .. or ADD button, include in that
=TABLEUPDATE(.t.)
Since you are adding or saving a DBF, the default alias used gets the TABLEUPDATE() as well.

This will be helpful, if you modify the form on a later date and change buffring strategy etc.. etc.
The exit button is an odd place.. unless the number of buttons and processes in the form is too few and there is no escape route. Example what if the user closes the form using x at top of form. Exit button may not be executed. But atleast, the save button pressing as the conculsive evidence for commiting a record can be understood by user.

Just my view...
Best of luck.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com

LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Thank you this has been most helpful

I would vote for you but somebody has denied me access to it.

Luv

Rachel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top