Question : vba code to perform maketable query and then open the form

I get a runtime error 3211 on my form's (call it frm) OnOpen event that the table (call it y) could not be locked....

This is what I am trying to do:

The recordsource of my  orm frm from a select query x.  The select query x uses a table called y.  However, this table y is always created from a MakeTable query z.  

So what I want to do is that when I open form frm, I want the maketable query z to finish running in order to create a "fresh" set of records in table y, which I can then use select query x to show me the relevant records when form frm is opened.  Can someone help me with this in VBA.  Thanks

Answer : vba code to perform maketable query and then open the form

then you have to use another form to open your form a Main Panel form and open the from using a Button

private sub Btn_Click()

DoCmd.SetWarnings False
DoCmd.OpenQuery "z PotentialMDRCountdown_IsPotentialMDR"
DoCmd.OpenQuery "z Service MDR Make Table Query"
DoCmd.SetWarnings true

'open your form
docmd.openform "X"

end sub


Random Solutions  
 
programming4us programming4us