Hi everyone.
I am trying to write some vba code to auto fill a cell's value based on the value of the cell in the previous record (In a datasheet form)
i.e. if the value in record one was '1' and the down-arrow key was pressed then the value '2' should be entered into the new\next record
I have written some pseudo-code to show what I am trying to accomplish, but as my knowledge of VBA is minimal I am having trouble writing the code
If anyone has the time to convert the mess below into something access will understand I would appreciate it, or failing that If you can point me in the right direction.
Thank you.
if keydown = down-arrow and current cell contents isnumeric then
Cval = current cell contents
if current record = last record then
create new record
move down 1 record
set cell value of new record to cval+1
else
move down 1 record
if cell value = null then set cell value of record to cval+1
end if
end if
I am trying to write some vba code to auto fill a cell's value based on the value of the cell in the previous record (In a datasheet form)
i.e. if the value in record one was '1' and the down-arrow key was pressed then the value '2' should be entered into the new\next record
I have written some pseudo-code to show what I am trying to accomplish, but as my knowledge of VBA is minimal I am having trouble writing the code
If anyone has the time to convert the mess below into something access will understand I would appreciate it, or failing that If you can point me in the right direction.
Thank you.
if keydown = down-arrow and current cell contents isnumeric then
Cval = current cell contents
if current record = last record then
create new record
move down 1 record
set cell value of new record to cval+1
else
move down 1 record
if cell value = null then set cell value of record to cval+1
end if
end if