appending new records to a table

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

Guest

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!
 
Dim tf as Boolean

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

With rst
.AddNew
!description = strDescription
!firstTime = tf
 
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.
 
"item cannot be found in the collection" refers to the field name being
incorrect. double check spelling maybe?
 
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!
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top