By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,206 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,206 IT Pros & Developers. It's quick & easy.

How do u open a form automatically after the make-table query is done?

P: 1
I am completely new to access. I have a make-table query that combines data from two/more tables, asks for a criteria, deletes the old table and produces a new table every time under the same name. The table is always linked up with a form to allows user to fill in certain rolls of the table.

A. How would you make the form pop out after the make-table query is done and the new table is made? Can I add a openform procedure in the sql code of the query? if so, how? If not, what should i do?

B. I am confused about how to restrict some of the properties of a table that is made new when a query is carried out.

Expand|Select|Wrap|Line Numbers
  1. ctMan.EquipID, ProjectMan.NumPart, Input.Date, Input.UserName, Input.UserWhoChanged, Input.DateOfChange, Input.[Memo/change reason] INTO DefaultQueryT
  2. FROM [Input] INNER JOIN ProjectMan ON (Input.EquipID=ProjectMan.EquipID) AND (Input.NumMainPart=ProjectMan.NumMainPart)
  3. WHERE (((Input.SerNumPart) Is Null) AND ((ProjectMan.NumMainPart)=[Main Part Serial Number?]));
Jul 8 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,221
There are a number of ways the launching of the form could be combined with the make-table query. One can't really suggest a "best" without know the operating environment and pre-existing events.

The big question is "how is the make table query" being launched. If that process is in vba code, then the form could be opened with a line or two more of vba code. It it's in a macro, one more instruction in the macro would do it. Or create a new macro to run the query and launch the form.

Why not launch the form first, and include a button on the form to run the query?

About part B, I'm afraid I don't know how to answer without researching it.

Jul 9 '10 #2

Expert Mod 15k+
P: 31,660
For B I would suggest a different approach. It is possible, though complicated, to set the various properties of a table and its fields, but I wouldn't go there unless I had to.

Instead, consider a defined table that you simply repopulate instead of recreate every time. Clearing the table and appending the new data is pretty straightforward in SQL. This way, your design is maintained through various usages.
Jul 11 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.