appending new records to a table

L

lula

hi to all..... I have a question. I'm grabbing some information from a word
document and add them to a table. One of those fields is a Yes/No field. How
do I write down in code that if word tells me it's a yes, in my new record in
that yes/no field I need it checked???

i.e.:
I have in my word doc the description of what happened and if it's the first
time it happened.

Dim strDescription As String
Dim str1time As String

' I grab the info from the word document
strDescription = oDoc.FormFields("Text6").Result
str1time = oDoc.FormFields("Dropdown1").Result

'add the info into my database
With rst
.AddNew
!description = strDescription
!firstTime = how do I do this part?????????

it would be something like this. like "ofer" told me once
If str1time = True Then
' checked ----------------> how do I do this????
else
' Not checked
End if


ok, thank you a lot in advance for your help. REally appreciate what you do!
 
S

SusanV

Dim tf as Boolean

If str1time = "Yes" then
tf = TRUE
else tf = FALSE
end if

With rst
.AddNew
!description = strDescription
!firstTime = tf
 
L

lula

hi susan... thank you for your answer... I tried that and when I tried to add
the record, I have a message saying:
"Item cannot be found inthe collection corresponding to the requested name
or ordinal"

any ideas what I am doing wrong???

thank you again.
 
S

SusanV

"item cannot be found in the collection" refers to the field name being
incorrect. double check spelling maybe?
 
L

lula

hey susan.... thank you very much!!! that was it.. I had capital T instead of
lower case.... really thank you for taking the time to answer my question. I
really appreciate it!
 
S

SusanV

Glad to help any time!

;-D

Susan

lula said:
hey susan.... thank you very much!!! that was it.. I had capital T instead
of
lower case.... really thank you for taking the time to answer my question.
I
really appreciate it!
 
Top