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

Help getting push button to function

Status
Not open for further replies.

UA61

Vendor
Apr 5, 2022
1
US
I placed a push button in my form to add a new record to the end of my table, I need the button to allow me to add a record and add a record number value to a field in the table called log#. Example: when I hit the new record button I need it to allow me to add a record and change the log# from 1 to 2 ect...
 
Assuming you open or attached a Tcursor(tc)
Move tc to wherever you want put the record like tc.end(), tc.home(), whatever.
Insert a new record after, before, etc.
Then say you have a column of record numbers called RECORDN, simply use tc.RECORDN.cmax()
That will give you the maximum # in that field in the entire table.
Then tc.RECORDN = tc.RECORDN.cmax() + 1 will do the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top