Run Time 2046 Goto Record acNewRec

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top