Print Active Access Window Using VB

J

JonC

I am developing an Access database and need to be able to print a form
with various selections made as it appears on screen. The standard way
of doing this would be to create a report based on the form but the
form is quite complex with nested subforms and page tabs and trying to
filter the records is proving to be a nightmare. I'm sure there must be

some VB code that could do this for me but I'm a bit of a novice.
Printing the screen would be fairly straightforward but I really want
to print just the form window. If anyone could offer any advice it
would be greatly appreciated. At the moment I'm pulling out what's left

of my hair.
 
R

RobinS

You might want to post this to an Access newsgroup.
There's a ton of them, and you're more likely to get
Access help there.

Robin S.
 
J

JonC

Thanks for the reply but I've already been down that avenue. The answer
seems to be some sort of VB so thats why I thought I'd try this group.
 
R

rowe_newsgroups

Thanks for the reply but I've already been down that avenue. The answer
seems to be some sort of VB so thats why I thought I'd try this group.

You might be right that the answer lies in VB, but I think you are
confused on "which" vb is needed. Access uses Visual Basic for
Applications (VBA), this is a scaled down version of what we refer to
as classic vb. The newgroup you are in is for VB.Net, the current, most
advanced version of visual basic. VB.Net has special syntax that is not
present in either classic vb or vba, and therefore will not work in
your Access project (not to mention it requires the .Net framework to
even run). If you want some code that will run inside of your Access
database, you need to post/search the Access newsgroup, it's google
groups url is
http://groups.google.com/group/comp.databases.ms-access/topics?lnk=srg&hl=en


If you are hellbent on using Vb.Net then you will have to probably have
to rewrite the form you want to print using in the new (.Net) language.
Microsoft has a free editor available for this - just search
microsoft.com for "Visual Basic 2005 Express Edition" Once you have
that you'll need to program in the built in functionality of the Access
forms, like retrieving records from the database and then allowing the
user to move between the records. I could keep going, but I think
you're getting the point that this will be a massive project,
especially since you don't know any/much visual basic. I would say this
will be about 25 times as hard as using the subforms and subreports you
mentioned in your original post.

Assuming that VBA still supports the classic VB print methods, you
might even browse that newsgroup (
http://groups.google.com/group/comp.lang.basic.visual.misc/topics?hl=en
) for some code that handles printing, but again printing in classic vb
was no walk in the park.

Overall, you're best bet is to just use the reports. Sure subreports
can get confusing, but they're nothing like trying to learn to
program...

Thanks,


Seth Rowe
 
J

JonC

Cheers Seth - You've probably sabed me a lot of wasted time and effort
(not to mention hair). I'll concentrate my efforts on working through
filtering the subreports.
 

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