update event out of a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I try to make a selection of available dates out of a form, and update an
other table with that selection.
I can see the selected date, triggered by the AfterUpdate event, in a
msgBox; but I'm not able to update the date in the other table.

Can somebody help me out with this
 
I found what I was loocking for. It is possible not the quickest way, and I
found some fault in It, but it can do the job:
Private Sub SelectDate_Click()
MsgBox "Selected date: " & Me.Date

'Defining the connection
Dim conn As ADODB.Connection
Set conn = CurrentProject.Connection

'Defining the recordset and datasource
Dim rstdate As New ADODB.Recordset
rstdate.ActiveConnection = conn

'Filling recordset with data
rstdate.Open "datum", , adOpenStatic, adLockOptimistic
rstdate.MoveFirst
rstdate!SelectDate = Me.Date
rstdate.Update
rstdate.Fields.Refresh
rstdate.MoveFirst

rstdate.Close
Set rstdate = Nothing
Set conn = Nothing
On Error GoTo Err_Input_claimdate_Click

Exit_Input_claimdate_Click:
Exit Sub

Err_Input_claimdate_Click:
MsgBox Err.Description
Resume Exit_Input_claimdate_Click
End Sub
 
Back
Top