If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Form Open Error Message
I added three new fields to a form and now I get the following error:
The expression On Open you entered as the event property setting produced the following error: return without GoSub Well I did not change the On Open event procedure.. here it is: Private Sub Form_Open(Cancel As Integer) DoCmd.GoToRecord , , acNewRec Me.subFormRepeatCalls.Enabled = False End Sub Interesting enough after I open and close the event procedure, I can open the form without problems. If I exit the database I get the same error. I deleted the fields, but I am still getting the same error PLEASE HELP |
#2
|
|||
|
|||
Form Open Error Message
Dinamo/Pistons -
I would search (Find) your whole project for any 'Return' statements. I would also compact/repair your database and re-compile it. It may not be in the Open method of the form you are looking at, so look everywhere. -- Daryl S "Dinamo/Pistons" wrote: I added three new fields to a form and now I get the following error: The expression On Open you entered as the event property setting produced the following error: return without GoSub Well I did not change the On Open event procedure.. here it is: Private Sub Form_Open(Cancel As Integer) DoCmd.GoToRecord , , acNewRec Me.subFormRepeatCalls.Enabled = False End Sub Interesting enough after I open and close the event procedure, I can open the form without problems. If I exit the database I get the same error. I deleted the fields, but I am still getting the same error PLEASE HELP |
#3
|
|||
|
|||
Form Open Error Message
Try recompile your code. Select All, Cut and Paste, DebugCompile Database.
or maybe some of your procedure missing "Exit Sub". Dinamo/Pistons wrote: I added three new fields to a form and now I get the following error: The expression On Open you entered as the event property setting produced the following error: return without GoSub Well I did not change the On Open event procedure.. here it is: Private Sub Form_Open(Cancel As Integer) DoCmd.GoToRecord , , acNewRec Me.subFormRepeatCalls.Enabled = False End Sub Interesting enough after I open and close the event procedure, I can open the form without problems. If I exit the database I get the same error. I deleted the fields, but I am still getting the same error PLEASE HELP -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
#4
|
|||
|
|||
Form Open Error Message
For one thing, the Open event is too soon to work with the recordset, as it
has not yet been loaded. The Load event would be the place for DoCmd. GoToRecord , , acNewRec (or Me.Recordset.AddNew). Other than that, try adding Option Explicit below Option Compare Database for each code module, then compile the code. To turn on that option (as you should anyhow), in the VBA editor go to Tools Options General tab, and check Require Variable Declaration (Access 2003 and earlier; not sure where it is in later versions). Why disable the subform in the Load event? Why not just set it on the Property Sheet? You can change it through code later, if you want. What do you mean by "open and close the event procedure"? What fields did you delete? Dinamo/Pistons wrote: I added three new fields to a form and now I get the following error: The expression On Open you entered as the event property setting produced the following error: return without GoSub Well I did not change the On Open event procedure.. here it is: Private Sub Form_Open(Cancel As Integer) DoCmd.GoToRecord , , acNewRec Me.subFormRepeatCalls.Enabled = False End Sub Interesting enough after I open and close the event procedure, I can open the form without problems. If I exit the database I get the same error. I deleted the fields, but I am still getting the same error PLEASE HELP -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
Thread Tools | |
Display Modes | |
|
|