R
Richdwills
Im running office 2007 and have a relatively simple bit of code that doesnt
seem to work. When I open a form the 'On Open' event should simple open a
form, input some data and then close it. The form I wanted to open as Hidden
so it's seemless operation. However, when i try to do this with hidding the
form it does work, says "Run-time error 2046". If I do this with the form
being visible (not hidden) it does work!?!?
---
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "TempU" , , , , , acHidden
DoCmd.GoToRecord acDataForm, "TempU", acNewRec
Forms!tempu!windowslog = Module1.fOSUserName
Forms!tempu!timein = Format(Now(), "hh:mm:ss")
Forms!tempu!datein = Format(Date, "dd/mm/yyyy")
DoCmd.Close acForm, "TempU"
DoCmd.Close acForm, "UserLog"
End Sub
Any ideas anyone?
Thanks
Rich
seem to work. When I open a form the 'On Open' event should simple open a
form, input some data and then close it. The form I wanted to open as Hidden
so it's seemless operation. However, when i try to do this with hidding the
form it does work, says "Run-time error 2046". If I do this with the form
being visible (not hidden) it does work!?!?
---
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "TempU" , , , , , acHidden
DoCmd.GoToRecord acDataForm, "TempU", acNewRec
Forms!tempu!windowslog = Module1.fOSUserName
Forms!tempu!timein = Format(Now(), "hh:mm:ss")
Forms!tempu!datein = Format(Date, "dd/mm/yyyy")
DoCmd.Close acForm, "TempU"
DoCmd.Close acForm, "UserLog"
End Sub
Any ideas anyone?
Thanks
Rich