PDA

View Full Version : VBA Forms



dattagal
09-07-2006, 07:50 AM
Hi again. I just posted but now I have another question:

In "nosing around" in the VBA window I encountered a VBA form (much like the form in VB). Can I just use this instead of the Word form? I am not exactly comfortable in VB/VBA but my comfort level there is higher than it is in a Word form. (Not to mention that it looks a lot cooler.)

Also, if I can use the VBA form instead of the Word form, how do I get to it? Can I go straight to it instead of the Word form or do I have to go to the Word form first? If I do go to the Word form first, how do I get to the VBA NOT in design form?

fumei
09-07-2006, 08:24 AM
Hi dattagal,

Using VBA forms (they are called userforms...although once they were called dialogs...whatever) is both fun and useful.

In many cases, yes, a userform is better than direct user entry into a document form. As there is commonly an OK button on a userform, this command ("OK") can be used to perform all sorts of logic and data validation.

In other words, one advantage of a userform is your can try and make sure all the information is correct THEN dump it into the document.

I am not sure what you mean exactly by using a VBA form 'instead of" the Word form. You still have to put whatever you pick up with the VBA form (userform) into the document.

A userform will run - that is, actually display NOT in Design Mode - with the .Show method. You can make it display automatically on document open if you want.

Tell us what you want exactly.

dattagal
09-07-2006, 12:57 PM
Okay, I am probably making this harder than what it has to be but I want a vba/userform to be what users see when they open my Online Request for Web Enrollment form.

I am not at all sure what you mean by "make sure all the information is correct THEN dump it into the document" but I assume you mean the vba/useform cannot stand alone - that it can only be used in connection with the Word form. Is this accurate?

If so, can it be set up so the user never actually sees the Word form; in other words:

The vba/userform displays automatically on document open
The user enters data in the vba/userform
The user clicks OK
The data is dumped into the Word form but seamlessly/behind the scenesAlso, what about saving the form; I'd really rather the user didn't have to REMEMBER to do a Save As to get me the information and yet not leave it there for the next user to see. I know you can set it up so the only the data is saved and it gets saved to a text file but that is not quite what I want either.

(See- I know just enough to be annoying.)

What I want (if the user ever has to see the Word form at all) is for the Save As diaglog box to open whether the user chooses it or chooses the Save icon.

Of course I would prefer the user could click on a "Send Info to Cindy" button on the userform and be done with it but that may be asking too much.

Come to think of it - all of this may be asking too much as I may not be able to incorporate your solutions anyway - due to my lack of skill with Word VBA.

For that matter, I would personally prefer to do all of this in Access anyway - with a data access page that users filled out - completely removing the need to send me anything b/c the data is all right there in the database from which I run reports to get the information I need.

Its just that I am not sure I want to take on a "let's use Access" task this early in the game. (I just started this job 2.5 weeks ago.)

This company/department is very good at making use of technology but people still tend to shy away from Access. On the other hand - if I can knock their socks off with Word, maybe they will trust my hand at a database.

Well, I am beginning to ramble now so I will go and wait and watch for your kind responses.

Thanks so much

Cindy