Hello!
Here is the code I'm working with:
The line in bold is intended to populate the field [Operational] in a table. This is an option group (valued 1 through 5) called "optOperational " on subform "sfrmSponMg mt."
My problem is simple, I can't seem to find the correct syntax to link the option group selection to the value to be added to the table. Is my syntax wrong? Or is there some trick to fetching a value from an option group that I'm unaware of?
Any help would be greatly appreciated.
Thanks,
Michael
Here is the code I'm working with:
Code:
Private Sub opbAddNew_Click()
Dim rstRiskRating As ADODB.Recordset
Set rstRiskRating = New ADODB.Recordset
With rstRiskRating
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open "Select * from tblRiskRating"
.AddNew
!PropertyID = Forms!frmNewRiskRating.txtPropertyID
!ValidDate = Forms!frmNewRiskRating.txtValidDate
[U]!Operational = Me!sfrmSponMgmt.optOperational[/U]
.Update
End With
rstRiskRating.Close
Set rstRiskRating = Nothing
DoCmd.Close
End Sub
My problem is simple, I can't seem to find the correct syntax to link the option group selection to the value to be added to the table. Is my syntax wrong? Or is there some trick to fetching a value from an option group that I'm unaware of?
Any help would be greatly appreciated.
Thanks,
Michael
Comment