Access Form Open New Record

%3CLINGO-SUB%20id%3D%22lingo-sub-2087821%22%20slang%3D%22en-US%22%3EAccess%20Form%20Open%20New%20Record%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2087821%22%20slang%3D%22en-US%22%3EI%E2%80%99ve%20created%20a%20database%20with%202%20split%20forms.%20I%20want%20to%20have%20access%20open%20to%20one%20specific%20form%20and%20once%20it%20opens%20I%20want%20to%20have%20it%20open%20to%20a%20new%20record.%20In%20the%20current%20database%20options%20I%20have%20selected%20the%20display%20form%20and%20in%20the%20on%20load%20event%20I%20have%20entered%20Private%20Sub%20Form_Load()%3CBR%20%2F%3EDoCmd.GoToRecord%20acDataForm%2C%20Me.Name%2C%20acNewRec%3CBR%20%2F%3EEnd%20Sub%3CBR%20%2F%3EWhen%20I%20do%20that%20within%20access%20it%20works%20fine%2C%20but%20once%20I%20close%20access%20and%20relaunch%20I%20receive%20Run-time%20error%20%E2%80%982046%E2%80%99%3A%20The%20command%20or%20action%20%E2%80%98GoToRecord%E2%80%99%20isn%E2%80%99t%20available%20now.%20When%20I%20don%E2%80%99t%20have%20the%20display%20form%20option%20it%20isn%E2%80%99t%20received.%20How%20can%20I%20get%20these%202%20features%20to%20work%20together%3F%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2087821%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2010%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor
I’ve created a database with 2 split forms. I want to have access open to one specific form and once it opens I want to have it open to a new record. In the current database options I have selected the display form and in the on load event I have entered Private Sub Form_Load()
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
End Sub
When I do that within access it works fine, but once I close access and relaunch I receive Run-time error ‘2046’: The command or action ‘GoToRecord’ isn’t available now. When I don’t have the display form option it isn’t received. How can I get these 2 features to work together?
0 Replies