B
bruce
Hi, all:
I have a subform, which RecordSource property is set by VBA. And
then, I want to bound one of recordset's field to a control, but It
sounds wrongly. Here is my code:
lngProblemID = Parent.GetProblemID
strSqlOptions = "SELECT Options.OptID, Options.ProbID,
Options.OptNote, Options.IsRight FROM Options"
strSqlOptions = strSqlOptions & " Where Options.ProbID = " &
lngProblemID
Me.RecordSource = strSqlOptions
Me.Requery
'Add new option record
Set recOptions = Me.Recordset
recOptions.AddNew
recOptions.Fields("ProbID") = lngProblemID
'set action property
With Me!bfrOption1
.ControlSource = "OptNote"
.Requery
.Class = "Word.Document"
.OLETypeAllowed = acOLEEmbedded
.Action = acOLECreateEmbed
End With
"OptNote" is one of Recordset's field,which is ole type. After I did
this, I can edit word in control normally, control's value is allright
indeed, but the recOptions.Fields("Prob") allways holding at Null.
What's the trouble with? Could I do it just like this way. If something
wrong, please wise me up! Thank you.
I have a subform, which RecordSource property is set by VBA. And
then, I want to bound one of recordset's field to a control, but It
sounds wrongly. Here is my code:
lngProblemID = Parent.GetProblemID
strSqlOptions = "SELECT Options.OptID, Options.ProbID,
Options.OptNote, Options.IsRight FROM Options"
strSqlOptions = strSqlOptions & " Where Options.ProbID = " &
lngProblemID
Me.RecordSource = strSqlOptions
Me.Requery
'Add new option record
Set recOptions = Me.Recordset
recOptions.AddNew
recOptions.Fields("ProbID") = lngProblemID
'set action property
With Me!bfrOption1
.ControlSource = "OptNote"
.Requery
.Class = "Word.Document"
.OLETypeAllowed = acOLEEmbedded
.Action = acOLECreateEmbed
End With
"OptNote" is one of Recordset's field,which is ole type. After I did
this, I can edit word in control normally, control's value is allright
indeed, but the recOptions.Fields("Prob") allways holding at Null.
What's the trouble with? Could I do it just like this way. If something
wrong, please wise me up! Thank you.