Wanted: vba code sample for for and sub-form

W

Will

1 - When you use the Wizard in Access to build a form and a sub form... does
it actually create vba code that you can look at and use as an example on
how to do it yourself?

If so, where can I find the code after I use the Wizard?

2 - Would anyone be kind enough to provide a simple vba example on how to do
this that I could use as a learning model?

thanks for any help.
 
A

Arvin Meyer [MVP]

The code is in the Wizards files (with names like:)

WZMAIN80.MDE

located in the Office folder. There used to be readable copies of some of
them available at Microsoft downloads. I don't think they are available for
the latest versions. Using CreateControl and CreateReportControl, you can
write them yourself. For a sample of what a form definition looks like use
my code at:

http://www.datastrat.com/Code/DocDatabase.txt

to look at your existing forms.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
L

Larry Linson

Will said:
1 - When you use the Wizard in Access
to build a form and a sub form... does
it actually create vba code that you can
look at and use as an example on
how to do it yourself?

Arvin has answered your question, in detail.

Now I will make a statement:

I have _never_, using Access since about a month and a half after the debut
of Access Version 1.0, had a business need to create a form, much less a
form and a subform, from code. The only instance in which I can envision
this being needed is writing a Wizard to create some particular kind of
form, not in a production application database.

If you will explain what it is that you are trying to accomplish, if it is
not a "specialized Wizard", it is possible that someone here can offer you a
suggestion of a significantly easier approach to solve the problem.

Larry Linson
Microsoft Access MVP
 
W

Will

Larry,

I'm not sure I understand your comment.

If you don't create forms... how do your users enter data into your
database?

Acesss normall does an OK job of doing this for you when you need it... but
I wanted to see how to do it using vba.

I think I missed your point... would you try again and educate me?

thanks,

Will
 

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