Evening,
I am working with D7 with SQL Server 2005, a form with DBNavigator and some DBEdit boxes.
I would like one of the DBedit boxes to display the new reference number when the insert button is pressed on the dbnavigator (increments after each new record 000124, 000125 and so on). I have used the following line of code to ensure the format of the reference remains consistent:
However when the insert button is pressed the new issue number is displayed as ‘124’ in the DBedit. I have tried the following:
Neither option seems to work. The format string is working (tested with showmessage) but I am doing something wrong after that. I have called the above in the Event 'BeforePost' from ADOTable.
As ever any pointers in the right direction would be welcome!
I am working with D7 with SQL Server 2005, a form with DBNavigator and some DBEdit boxes.
I would like one of the DBedit boxes to display the new reference number when the insert button is pressed on the dbnavigator (increments after each new record 000124, 000125 and so on). I have used the following line of code to ensure the format of the reference remains consistent:
Code:
Temp:=Format('%.6d', NewIssue); // this works ok
However when the insert button is pressed the new issue number is displayed as ‘124’ in the DBedit. I have tried the following:
Code:
frmMain.DBEdit1.Text := Temp;
Code:
IssueTable.FieldByName('IssueNo').AsString := Temp;
Neither option seems to work. The format string is working (tested with showmessage) but I am doing something wrong after that. I have called the above in the Event 'BeforePost' from ADOTable.
As ever any pointers in the right direction would be welcome!