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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display in txtboxes and tableupdate() 1

Status
Not open for further replies.

sashaDG

Programmer
Jun 20, 2022
112
BY
Hi all. You help me a lot with FOKSPR, my respect to you! Next question:
The pageframe.page1 has an ADD button

Code:
SELECT main_dir
=CURSORSETPROP("Buffering", 3)
APPEND BLANK

ThisForm.Pageframe1.ActivePage = 2

In pageframe1.page2 i have empty(cause append blank) textBoxes whose source is maindir.colum.
I write to textBoxes and save, everything works well
Code:
WITH Thisform.pageframe1.page2
	.txtKpost.Value = ALLTRIM(main_dir.Kpost)
	.txtNaimp.Value = ALLTRIM(main_dir.Naimp)
	.txtNaim.Value = ALLTRIM(main_dir.Naim)
	.txtOdse.Value = ALLTRIM(main_dir.Odse)	
ENDWITH

=TABLEUPDATE()
=CURSORSETPROP("Buffering", 1)

ThisForm.Pageframe1.page1.Enabled = .T.
ThisForm.Pageframe1.ActivePage = 1
ThisForm.pageframe1.page1.Refresh

But in the pageframe1.page2 there is a button 'Add from another table' (DO FORM search)

By clicking the search.btnAdd, txtBoxes in the pageframe1.page2 are filled with data from the FORM search.
Code:
WITH NameMainForm.pageframe1.page2
	.txtKpost.Value = ALLTRIM(SortedData.Kpost)
	.txtNaimp.Value = ALLTRIM(SortedData.Naimp)
	.txtNaim.Value = ALLTRIM(SortedData.Naim)
	.txtOdse.Value = ALLTRIM(SortedData.Odse)
	.txtKol.Value = SortedData.Kol
	.txtCena.Value = SortedData.Cena
	.txtSumma.Value = SortedData.Summa		
ENDWITH
*!*	NameMainForm.PAGEFRAME1.PAge1.grdMain_dir.SetFocus
*!*	NameMainForm.PAGEFRAME1.PAge1.grdMain_dir.REFRESH
UsedBtn3Chose= .T.
ThisForm.Release
CLEAR EVENTS

At THIS moment[highlight #FCE94F] I don't need[/highlight] click BtnSave, because if I go to page1 to the main_grid, the record will already be filled. That is, it automatically makes a tablupdate.

I want to control the addition from the form search: after the btnAdd button, so that you have to click the BtnSave or Editbtn(there is record that I added and which must be filled in the txtBoxes). I think it's the assignment in the btnAdd.
 
mike said:
It seems to me that, if the source data is wider than the target field, any extra spaces will be truncated. If the target field is wider than the source, it will be padded with spaces. Either way, the ALLTRIM() appears to be redundant.

I understand what you mean, if you remove nothing will change
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top