Hi all, I have a program in which I would like to open an access database (which has a form on open). however the code I have only works every second time I run the code, and to be honest, I have no idea why. I have tried multiple things, but none of them work (any more than every second try). If you can see a way to do this it would be great, heres what i have tried that came close.
Code:
stDocName = "FrmBookIn"
stLinkCriteria = "[BookIn Referance]= 0108061500"
Shell "msaccess.exe """ & Path & """", vbMaximizedFocus
Access.DoCmd.OpenForm stDocName, , , stLinkCriteria
Code:
Shell "msaccess.exe """ & Path & """", vbMaximizedFocus
Wait = Timer
While Timer < Wait + 3
DoEvents 'do nothing
Wend
Access.Forms![FrmBookIn]![BookIn Referance].SetFocus
Access.DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70