G
Guest
Hi. I have created two SELECT queries and one APPEND query, and I want all of
them to run behind the Command Button of a form automatically. So far I have
used the code listed below:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryItemsInStock"
DoCmd.OpenQuery "qryPercentageOfStock"
DoCmd.OpenQuery "qryOrder"
DoCmd.SetWarnings True
DoCmd.GoToRecord , , acNewRec
It opens "qryItemsInStock" and "qryPercentageOfStock" but then a message box
appears "You can't go to specified record". Any idea why this happens?
Or what about RunSQL, is that better to use?
them to run behind the Command Button of a form automatically. So far I have
used the code listed below:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryItemsInStock"
DoCmd.OpenQuery "qryPercentageOfStock"
DoCmd.OpenQuery "qryOrder"
DoCmd.SetWarnings True
DoCmd.GoToRecord , , acNewRec
It opens "qryItemsInStock" and "qryPercentageOfStock" but then a message box
appears "You can't go to specified record". Any idea why this happens?
Or what about RunSQL, is that better to use?