Hi,
This is the scenario
1 - you have a table with one column: col (stores current date)
2 - you create a form with datasheet default view
3 - for some reason, you want to write a little vba that has the following effects when you press enter key:
a - the entered value never gets into the database
b - the field in the data sheet control is cleared
achieves a), but you have no idea how to achieve b).
Things tried that didn't work (throw errors):
Thank you very much
This is the scenario
1 - you have a table with one column: col (stores current date)
2 - you create a form with datasheet default view
3 - for some reason, you want to write a little vba that has the following effects when you press enter key:
a - the entered value never gets into the database
b - the field in the data sheet control is cleared
Code:
Private Sub col_BeforeUpdate(Cancel As Integer)
Cancel = true;
end sub
Things tried that didn't work (throw errors):
Code:
Me.col = Null Me.col = Nothing
Thank you very much
Comment