paul.raeburn
PR
- Local time
- Today, 11:23
- Joined
- Apr 29, 2001
- Messages
- 47
I am trying to update a field when a user select a record from a combo
box... but I do think I have over complicated it... I want to update the
date when the record = two types of members and any other it has a null
date... I have but this on the after update property of the control...
start cof code
>>>>>
Private Sub AWSAMembership_AfterUpdate()
Dim rstAGA_AWSA As ADODB.Recordset
Dim ctl_awsa_rod As Date
' get AWSA Run out date from the ROD table
ctl_awsa_rod = DLookup("awsa_rod", "tbl_membership_rod")
Set conDatabase = CurrentProject.Connection
'Set rstAGA_AWSA = New Recordset
rstAGA_AWSA.Open tblPersonnelDetails, conDatabase, adOpenDynamic,
adLockOptimistic
If Me.AGAMembership = "Full Annual Member" Or Me.AGAMembership =
"Associate Annual Member" Then
With rstAGA_AWSA
!awsa_rod = ctl_awsa_rod
.Update
'Else
'With rstAGA_AWSA
' Do While Not .EOF
' !awsa_rod = " "
' .Update
'End With
End With
End If
rstAGA_AWSA.Close
conDatabase.Close
Set rstAGA_AWSA = Nothing
Set conDatabase = Nothing
End Sub
<<<<
end of code
many regards - Paul
box... but I do think I have over complicated it... I want to update the
date when the record = two types of members and any other it has a null
date... I have but this on the after update property of the control...
start cof code
>>>>>
Private Sub AWSAMembership_AfterUpdate()
Dim rstAGA_AWSA As ADODB.Recordset
Dim ctl_awsa_rod As Date
' get AWSA Run out date from the ROD table
ctl_awsa_rod = DLookup("awsa_rod", "tbl_membership_rod")
Set conDatabase = CurrentProject.Connection
'Set rstAGA_AWSA = New Recordset
rstAGA_AWSA.Open tblPersonnelDetails, conDatabase, adOpenDynamic,
adLockOptimistic
If Me.AGAMembership = "Full Annual Member" Or Me.AGAMembership =
"Associate Annual Member" Then
With rstAGA_AWSA
!awsa_rod = ctl_awsa_rod
.Update
'Else
'With rstAGA_AWSA
' Do While Not .EOF
' !awsa_rod = " "
' .Update
'End With
End With
End If
rstAGA_AWSA.Close
conDatabase.Close
Set rstAGA_AWSA = Nothing
Set conDatabase = Nothing
End Sub
<<<<
end of code
many regards - Paul