954,559 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Bookmarks

How can i print values on the word document from access table,there are more than 1 records for a single person
Here recordcount holds 4 values,bt it is not beng printed on the word doc,it is coming out of the procedure

If rs.RecordCount <> 0 Then
    If Not IsNull(rs!Name) Then
        WordDocument.Edit "Nm"
        strEntr = rs!Name
        strEntr = AppWord.set_Mixcase(strEntr)
        WordDocument.Insert strEntr
    End If
    If Not IsNull(rs!BANK) Then
        WordDocument.Edit "BnkNm"
        strEntr = rs!BANK
        strEntr = AppWord.set_Mixcase(strEntr)
        WordDocument.Insert strEntr
    End If
End If

Please help

dev_kc
Light Poster
35 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

How 'Bout using code tags, and reading the office tutorial?
http://www.daniweb.com/tutorials/tutorial51307.html

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

Coz that doesnt help,my word document is opening properly,n current date bookmark is working jst fine,i m not able to print values from table,bt from text box its working fine.It is jst goin in 1 if condtn n leaving rest of them,so thats the main prob........

dev_kc
Light Poster
35 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

mkay. Have you done a msgbox on rs.RecordCount, to ensure it has the right number of elements? Like, just before the first if?

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

yes rs.recordcount is correct,bt at this line,it is comin out of the procedure
strEntr = AppWord.set_Mixcase(strEntr)
although strEntr is holding the correct value
It is not going to Mixcase procedure,bt whn i am using textbox,values are being printed just fine.This is the code I used for textbox:
If txtName.Text <> "" Then
WordDocument.Edit "Nm"
Selection.Text = txtName.Text
strEntr = Selection.Text
strEntr = AppWord.set_Mixcase(strEntr)
WordDocument.Insert strEntr
End If

Please help,how can i print all the values which are there in the table corresponding to the PSno.....:-O

dev_kc
Light Poster
35 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You