Is there a way to affect what is returned my MSQuery from w/in the Doc?

J

JeffP@Work

If a user types in a Contact name, can can I pass in that into MSQuery to
find the appropriate address from another table?
 
P

Peter Jamieson

There are several ways you can get data out of a table once you have some
key info. such as a name, but MS Query isn't the one I'd start with.

If for example a user is typing a contact name in response to a FILLIN
field, you might be able to get the data you want directly into a Word
document using a DATABASE field, if the contact name is in the address table
and is unique.

If on the other hand you need something more complicated than that, your
best bet is probably to use Word VBA and ADO to get the data.

If you can provide a bit more info. about what exactly you are trying to do,
we may be able to make some suggestions.

Peter Jamieson
 
J

JeffP@Work

Peter, Thanks....

Due to other aspects I too came to the conclusion that I should use VBA and
ADO.

I'm working with an application that is a DDE server and is capable to
lauching word and a specific doc template.

But I have some commision coding that could be one to three agents, their
ID's splits etc that is contained in a few SQL tables and I don't really
want to add all those user defined fields to the application if I don't have
to.

I was going to use a web page because then I'd be able to query the current
contact and process an sProc to get the correct commision coding.

BUT, I have two barcodes in the doc, Bar128 which uses special codes
contained in a hidden field w/in the app to represent the caseNo, and
bar3of9 for a doc code that is contained in a mergefield and changes
depening on certain conditions and I wasn't able to get the barcode fonts
working in a webpage, I know it can be done but not with the barcode dll
that I currently have.

So, I'm back to word, and because I already have a generic AddIn from the
application, I may try to write my VBA w/in this one doc.

I may have to put a cmdButton w/in the doc which runs against our paradigm
that humans do little to print, (I have nearly 600 doc's that are
automatically printed depending on the case from two servers) but since
there are 5 caseMgrs who only get about 25 of these a day, I may opt for a
manual print.

This is just one of about 4 docs that automatically print in a caseMgr
submission package, but the only one that doesn't go to the client, it's
used as a title page for scanning the clients application and any other docs
to a repository, the barcodes provide indexing info to the repository.

I'll be back with VBA ADO woos soon enough.

TIA

JeffP....
 
P

Peter Jamieson

Yes, if you're already working with a DDE server I suspect that trying to
work with a second one would be asking for trouble! I can't remember if the
MS Query DDE stuff is documented in Help or online, but I have some old
documentation for its predecessor Q+E if you need it.

IMO you will probably find you can do whatever you want using ADO and SQL
SELECT statements and functions in the appropriate dialect - if all your
tables are in a SQL Server DB, you just use Transact-SQL. Or you can
manipulate string data after you get it back. If your data is coming from
several completely different databases, both SQL Server and Jet have
mechanisms for linking tables and querying them as if they were all in a
single database.

Not that I've worked with ADO all that much recently...

On the barcode front, there have been a couple of threads in here in the
last few months, pointing to one or two useful sites (you can search these
messages in Google groups). Otherwise, not my area!

Peter Jamieson

Peter Jamieson
 

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

Top