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

Proper way of refreshing forms?

Status
Not open for further replies.

august

MIS
Aug 24, 2000
150
PH
What is the proper way of refreshing forms?

Prog. sample:

if not empty(IDno)
append blank
replace name with this.txtname.value,;
addr with this.txtaddr.value
endif
thisform.REFRESH

is'nt the right way? but the record i already input is still there? Any suggestion? what is the simple workaround?

thanks,
august
 
august

if not empty(IDno)
[tab]append blank
[tab]replace name with this.txtname.value,;
[tab][tab]addr with this.txtaddr.value
[tab]this.txtaddr.value = []
endif
thisform.REFRESH

You may want to look at INSERT - SQL as an alternative to to appe blan.

Chris

 
If you need to buffer chanes, better bind your controls to table fields (this.txtname.ControlSource = 'name' and this.txtaddr.ControlSource = 'addr'). Set buffering mode for your table to 3 at form Init (function CursorSetProp('Buffering',3) ). Than: When you need to add record, always use 'append blank' BEFORE any data editing. To save data - use tableupdate() function. By such way you may have 100 controls on form, but still do not need to write special code just to clear all fields. They will be cleared automatically after 'append blank', because controls are bound. Note that you will need also to use tablerevert() at the end of working to clear out extra empty record, otherwise cursor will not be closed with 'uncommitted changes' error.
 
thanks to guys! i have now my first "mini" program.
thank you very very much!!!

a many thanks,
August [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top