Re: Word Macro Problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



Dear Jazabel,
I will make it easier for you to understand my problem. I am very new
to VBA but I know working of macros & use of it. But when it comes to
retrieve data from Ms-Access on to word document I feel my self very-2
novice. I have an application from where I open Word document on the
basis of self made Template other than Normal.dot. I copy my template
at runtime & replace Normal.dot. Now My document opens according to my
template. Now Use of macros starts from here. I have made Module &
write function to access data from MS-Access. When i press key let say
<Alt> + M the query is attached to it is fired & retrieve some data
from table. when i pass this data in message box it displays proper
record. Thing I have to do is to display that data in word document.
Only solution i want is that to display record from MS-Acess onto word
document at Line first of the document.
I hope you will get clear picture of my problem this time.

Thanx

Amod


Jezebel wrote:
'Binding' has a special meaning in data applications, and I think it's not
what you really mean.




"VBANovice" <amod.kumar29@xxxxxxxxx> wrote in message
news:1152618427.380378.182260@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear Jezebel...

I want to display data from ms-access into ms-word controls using
keystokes. My query is running accurately but i am not able to bind it
to Label control in word document.
Record is displaying properly when I press keystokes into the MsgBox
but not able to display those records in Label Control.

expecting u'll give clear solution from urside....

thanx .....


Jezebel wrote:
This gets very messy. Do you really want to bind it, or just read the
data
and display it?



"VBANovice" <amod.kumar29@xxxxxxxxx> wrote in message
news:1152614221.292320.253350@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
thanx Jezebel

How can I bound label control with data from ms-access.





Jezebel wrote:
1. Create a function that retrieves data from your database. The
function
should take an argument -- the letter for which you want to retrieve
data,
eg --

Private Sub GetNames(FirstLetter as string)

... retrieve and insert ...
... SELECT [Name] FROM MyTable WHERE ([Name] like '" &
Left$(FirstLetter,1) & "*'";)

...
End Sub


2. Create a method for calling this macro, specifying the argument.
You
could use 26 separate macros, eg --

Sub GetNames_L()
GetNames("L")
End Sub

etc

... but you might want to play around with this. There are many other
options for user input; eg a userform and an input box.





<amod.kumar29@xxxxxxxxx> wrote in message
news:1152601508.527021.213080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Is Any one can tell me about this.

I have to fetch data from MS-Access into word document by pressing a
different keystrokes.

Let here is example wht i have to do...
In open word document When I press keystroke <Alt>+M...it would
retrieve data whose names starts with 'M' from ms-access table ;
similarly if i press <Alt>+L...it would retrieve data whose names
starts with 'L' from ms-access table .
And how to display these data in word document. I am using macros
but
when i create one macro with keystroke other keystroke doesn't work.

Can anybody solve this problem & guide me how i can get out from
this
problem.


Thanx.......




.


Quantcast