I have some VBA code that inserts the current date into a record when you click on an unbound button in my form. When you click, it does add the date to the table, but the changes aren't displayed in the form unless I refresh the form. I added me.refresh to the code and while that helps, it always returns my form to the first record. Is there a way to refresh the form and have it stay on the record i'm editing?
I'm using windows XP and Office 2003. Here's my code:
Thanks in advance!
brian
I'm using windows XP and Office 2003. Here's my code:
Code:
Private Sub Command60_Click()
On Error GoTo Err_Command60_Click
Dim db As CurrentProject
Dim strSQL As String
Set db = CurrentProject()
strSQL = _
"UPDATE dbo.PaperApp SET PriorityDate = CONVERT(CHAR(10), GETDATE(), 101) WHERE (SSN = "
strSQL = strSQL & Me!SSN & ")"
DoCmd.RunSQL strSQL
Me.Rerefresh
Exit_Command60_Click:
Exit Sub
Err_Command60_Click:
MsgBox Err.Description
Resume Exit_Command60_Click
End Sub
Thanks in advance!
brian