Building a form using VBA

  • Thread starter Thread starter Robin Kuijstermans via AccessMonster.com
  • Start date Start date
R

Robin Kuijstermans via AccessMonster.com

I want to create my forms using VBA. I can make a subroutine for
fields/buttons that are used in more than 1 form, so I don't have to do
something twice. But the problem is: I don't know how I can add elements to
a form.

I browsed through the objects from the access library, but that didn't
bring me any further. Perhaps it's in an other library, but which one.

please help me

thanks
 
Pardon me Robin, I am not trying to be a smart ass, but why in the world do
you want to do that? I know it can be done, but it would be a lot of tedious
coding. When you say elements, do you mean properties? like
objFrmNewfrm.txtname.Fontsize = 10
 
I wrote an add-in for creating wizards, and can imagine some other possible
uses. If you do a lot of work in Access, it beats using the built-in
wizards and then cleaning up the mess....or creating everything manually.

But to answer the OP's question, there is no library to add...you just need
to use the CreateControl method. See help for syntax and usage.
 
with elements, I actually meant to add things like buttons, check boxes,
text boxes, combo boxes, etc. to a form

and if several forms uses the same button, I only make it 1 time in VBA and
use it on all the forms. also (as I thought) I could be doing the format of
the forms, only editing the code and all forms are changed.

that's why I wanted it or is there a better and easier way to do this?

thanks
 
thanks, I as far as I looked it up, I think this is what I meant.
but it's kinda late now, so I'm going to try it tommorrow.

Robin
 
Back
Top