General information
Category:
Coding, syntax & commands
I use a variable called autoincrement. When it equals true, I do this code in the add button
if autoincrement = .T.
select (tablename)
private oldord
M.OLDORD = ORDER()
set order to &indexname desc
go top
store &fieldname to m.oldnum
m.newnum = m.oldnum + 1
SET ORDER TO &OLDORD
endif
APPEND BLANK
if autoincrement = .T.
* insert form.fieldname.value = m.newnum and set
* form.fieldname.readonly = .T.
&formfield = m.newnum
&formfield2 = .T.
endif
the formfield is a hidden textbox on my form, that dipslays the new number and its control source is assignment.assignid which is the index in the table.
The problem is when I click add on both machines the assignid = 14
Thanks,
Tyler
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only