Building a database from code

R

Rob Bunocore

I have a client who I built a system for in Access 2003. This user
has a need to transfer data to a show copy of the system. They are
not networked nor can they be.

My model was basically that when she clicked on Export Data button it
would:
1. Create a new database from code.
2. Make table queries would run, creating the appropriate tables in
the newly created database.
3. A password would be set on the database.
4. Query's would be created on the database.
5. A single form would be created on the database and named
StartupForm.
6. The new database's startup properties would be set to
automatically open the StartupForm.

I built all these things on the main system and was using
Docmd.Transferdatabase command to transfer the objects. This was
approach worked great until I saved teh file as an MDE file. As an
MDE it won't let me transfer the form StartupForm to the new database.

My idea was once this new database was created, the user could email
it to the other users and all they would have to do is open the
database.

My question is basically, when creating a form from code, how do you
careate event procedures to the controlls that were created?

Thanks.

Robby
 
6

'69 Camaro

Hi, Robby.
My question is basically, when creating a form from code, how do you
careate event procedures to the controlls that were created?

Don't do it that way. Split the database into a front end and back end.
The front end will contain all of the forms, queries, modules, et cetera,
and the back end will contain all of the tables and relationships. A copy
of the front end should reside on each workstation, while the back end
resides on a shared network server. Whenever the data needs to be replaced
with new data, your client can send out a copy of her current back end. The
front end will still link to it if it's named the same and is placed in the
same directory. No creating a new database, queries, setting database
passwords, et cetera. Much, much easier.

For more information on splitting the database, please see the "Split the
Database" tip on the following Web page:

http://www.Access.QBuilt.com/html/gem_tips1.html#SplitDB

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
R

Rob Bunocore

Hi,Robby.


Don't do it that way. Split the database into a front end and back end.
The front end will contain all of the forms, queries, modules, et cetera,
and the back end will contain all of the tables and relationships. A copy
of the front end should reside on each workstation, while the back end
resides on a shared network server. Whenever the data needs to be replaced
with new data, your client can send out a copy of her current back end. The
front end will still link to it if it's named the same and is placed in the
same directory. No creating a new database, queries, setting database
passwords, et cetera. Much, much easier.

For more information on splitting the database, please see the "Split the
Database" tip on the following Web page:

http://www.Access.QBuilt.com/html/gem_tips1.html#SplitDB

HTH.
Gunny

Seehttp://www.QBuilt.comfor all your database needs.
Seehttp://www.Access.QBuilt.comfor Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.comhttp://www.Access.QBuilt.com/html/expert_contributors2.htmlfor contact
info.










- Show quoted text -

Thanks for your response. Your solution won't work though but I think
its because you I didn't make it clear as to what my situation is...

Picture 4-5 workers all over the country. They each do data entry and
when they are finished, need to send their data to a central person.
The data entry workers should always only have the data that they
entered and never see the data of others. So when they are done, they
need a way to send their data to the central person. This is why I
was exporting the data to a newly created database. Then they are
going to FTP or Email it to the right person.

Robby
 
R

Rick Brandt

Rob said:
On Feb 16, 4:41 pm, "'69 Camaro" <ForwardZERO_SPAM.To.
(e-mail address removed)_SPAM> wrote:
Thanks for your response. Your solution won't work though but I think
its because you I didn't make it clear as to what my situation is...

Picture 4-5 workers all over the country. They each do data entry and
when they are finished, need to send their data to a central person.
The data entry workers should always only have the data that they
entered and never see the data of others. So when they are done, they
need a way to send their data to the central person. This is why I
was exporting the data to a newly created database. Then they are
going to FTP or Email it to the right person.

In that scenario the database that is sent need not have anything but the data
which the recipient would import into a central database. No need to put all of
the non-data objects in the file. Just create a blank mdb and then export your
tables into it.
 

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