Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to run a make table query when a form opens 1

Status
Not open for further replies.

AussieCandii

IS-IT--Management
Jun 28, 2001
3
US
I needed to put a subform on a main form (Item Phrases) controlled by a specific field. The data on the subform came from two related tables. I could not then add to or change the recordset.

I got over this problem by combining the two tables for the subform into one. However, now I need to ensure that the table I made is consistent with the tables it came from.

Basically, before the user opens the main form (Item Phrases), I need to get the make table query to run again (silently, if possible - ie. no prompts from Access "This table already exists.... you're about to add xxx records, etc") to ensure that all data is available in the form.

I'm not sure if I'm making this clear, but would be grateful if anybody could help.

In addition, on another form (Item Info), I have several fields (bound to the data table) which need to rely on data picked from a combo box. I've tried using Refresh, but then I get an error message about single row update causing an error - even when no changes have been made to the underlying data. Is there a way I can autofill the remaining data on my form?

Here's hoping ..........

AussieCandii
 
Dear Aussie :)

Do u want to run a make table query based on Select query..? If thats is the case then this code could help u. Just add this code behind any suitable event.

DoCmd.SetWarnings False
'-- this will set warnings false n u'll not get any prompt

DoCmd.RunSQL ("select Myfiled1,Myfield2 into Mytable2 from MyTable1 order by myfield1")
'-- Will create a new table called Mytable2 based on the
'-- query from table1. U can join many tables in query.

DoCmd.SetWarnings True

DoCmd.OpenForm "MyForm", acNormal, "", "", , acNormal


Hope this will help u :)

Cheers!
Aqif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top