Need help - Two easy question

  • Thread starter Stéphane Pelletier
  • Start date
S

Stéphane Pelletier

Hi everyone,

Two question, and hopefully two answer

First ...

Is it possible to create and/or delete table inside a sub.
I know that we can create a table using:
Table wizard,Design view or datasheet,
but that doesn't help me ... I want to be able to create
it whenever i need it and then delete it when I have
finish with it. Kind of temporary Table ...

IF i had to do it with an Oracle DB I would know how to
do it, but since i'm working on Access ... not sure if it
is possible And I dont think that the SQL coding use with
an Oracle DB would work in Access.

If yes ... how can i do it?

Second question

Is it possible to deactivate de X square on the top right
corner ... the one that close Access. I would like to
force user to use a built "exit button" instead of the X
square.

If yes ... again ... please how can I do it.

Thank you for your help ...

Stéphane Pelletier
 
V

Van T. Dinh

(Since 2 questions are not related, you should post as 2
separate messages. Potential respondents who knows the
answer to one question are ocassionally reluctant to
answer one question but not the other.

In addition, don't say *easy* questions. Firstly, if you
don't know how to do them, how would you know whether they
are easy to do or not? Secondly, some knowledgeable
respondents will skip the "easy question" posts and leave
them for someone else less knowledgeable to answer.)

See comments in-line for answers.

HTH
Van T. Dinh
MVP (Access)


-----Original Message-----
Hi everyone,

Two question, and hopefully two answer

First ...

Is it possible to create and/or delete table inside a sub.
I know that we can create a table using:
Table wizard,Design view or datasheet,
but that doesn't help me ... I want to be able to create
it whenever i need it and then delete it when I have
finish with it. Kind of temporary Table ...

IF i had to do it with an Oracle DB I would know how to
do it, but since i'm working on Access ... not sure if it
is possible And I dont think that the SQL coding use with
an Oracle DB would work in Access.

If yes ... how can i do it?
Yes. You can use the CREATE TABLE / DROP TABLE SQL to
create / delete Tables. See Access Help for syntax for
above SQL DDL language.

You can use the Execute Method to execute the SQL
statements in VBA. See Access VB Help on Execute.

If you want to use DAO, you can also use the
CreateTableDef / Append Method of the TableDefs Collection
to create a Table in your database. To delete a Table,
you can use the Delete Method of the TableDefs Collection.
See Access VB Help on these terms.

To use DAO, make sure you add the DAO Library to the
References Collection of your database.


Second question

Is it possible to deactivate de X square on the top right
corner ... the one that close Access. I would like to
force user to use a built "exit button" instead of the X
square.

If yes ... again ... please how can I do it.

If you don't have a Form that is always open, create a
dummy Form (hidden) and open this dummy Form as soon as
you open the database. Then you can use the Form_Unload
Event of this Form to cancel the action of the Close (X)
button.

However, remember that users can always use Ctrl + Alt +
Del to kill your Access apllication (and possibly, corrupt
the database), so don't make it too hard and increase the
users' frustration.
 

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