SimonPGreen
IS-IT--Management
Hi all,
I would like to prepopulate a record based on another record in the table and need to define a variable that is the TOP value + 1 of the existing values for the field in the table. When a user then adds a new record the field is therefore prepopulated with an incrementing number. This number can then also be edited if the number autogenerated should not be sequential as thia happens on occasion.
I basically need to assign the value of the following query to a variable and add 1:
select top intValuationNumber from applications where fkPackageRef = me!fkPackageRef.
Can Dlookup do this or is it possible to execute the query directly in VBA and assign the value to a variable?
Appreciate any help.
Regards,
Simon
I would like to prepopulate a record based on another record in the table and need to define a variable that is the TOP value + 1 of the existing values for the field in the table. When a user then adds a new record the field is therefore prepopulated with an incrementing number. This number can then also be edited if the number autogenerated should not be sequential as thia happens on occasion.
I basically need to assign the value of the following query to a variable and add 1:
select top intValuationNumber from applications where fkPackageRef = me!fkPackageRef.
Can Dlookup do this or is it possible to execute the query directly in VBA and assign the value to a variable?
Appreciate any help.
Regards,
Simon