Return without gosub access ошибка

Why do I get a

«Return without GoSub»

error when using subforms in Access 2007?

asked Jul 13, 2012 at 9:29

Sinister Beard's user avatar

Sinister BeardSinister Beard

3,54312 gold badges58 silver badges94 bronze badges

This can occur when there is a Form_Load() event in the subform, but not the main form. Try adding an empty Form_Load() event to the main form.

answered Jul 13, 2012 at 9:29

Sinister Beard's user avatar

Sinister BeardSinister Beard

3,54312 gold badges58 silver badges94 bronze badges

6

Performing a decompile of the VBA code and recompiling followed by compacting my database resolved the issue for me.

answered Apr 10, 2015 at 14:55

c_rugby's user avatar

2

I had something similar (not specifically in VBA, but with using a form to update a subform). I just added a «StopAllMacros» step at the end of the screen updating object and it seemed to work.

enter image description here

answered May 31, 2019 at 15:12

Chris's user avatar

ChrisChris

255 bronze badges

  • Remove From My Forums
  • Question

  • I have a form that has a subform. whenever, I attempt to add records to this subform I receive the following message: The LinkMaster Fields Property setting has produced this error: «Return without GoSub»   How can I correct this?

Answers

  • Hi NoviceVBAuser1775,

    «Return without GoSub» means that
    you have a Return statement that can’t be matched with a GoSub statement.

    Make sure your GoSub statement wasn’t inadvertently deleted.

    You can get more detail about this error from link below:
    Return without GoSub (Error 3)

    This error is runtime error and it is a code issue. It means that complie will not address this issue. I suggest that you check code to see whether the code is correctly. For example, the code below will throw this error if we commnet the code «Exit
    Sub»:

    Sub TestError()
    
    Debug.Print "begin.."
    GoSub label1
    
    Exit Sub 'comment this line will cause this issue
    
    label1:
    Debug.Print "1"
    label2:
    Debug.Print "2"
    Return
    End Sub

    If you still have problem fixing this issue, I suggest that you share with us the code snippet you are developing with.

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

    • Edited by

      Friday, April 10, 2015 6:45 AM

    • Marked as answer by
      Fei XueMicrosoft employee
      Wednesday, April 15, 2015 12:23 PM

title keywords f1_keywords ms.prod ms.assetid ms.date ms.localizationpriority

Return without GoSub (Error 3)

vblr6.chm1011266

vblr6.chm1011266

office

396d3d0f-6af2-4709-bf3c-3a35668398d7

06/08/2017

medium

Return without GoSub (Error 3)

A Return statement must have a corresponding GoSub statement. This error has the following cause and solution:

  • You have a Return statement that can’t be matched with a GoSub statement. Make sure your GoSub statement wasn’t inadvertently deleted.

Unlike For…Next, While…Wend, and Sub…End Sub, which are matched at compile time, GoSub and Return are matched at run time.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

[!includeSupport and feedback]

Почему я получаю ошибку «Возвращение без GoSub» при использовании подформ в Access 2007?

4b9b3361

Ответ 1

Это может произойти, если в подформе есть событие Form_Load(), но не основная форма. Попробуйте добавить пустое событие Form_Load() в основную форму.

Ответ 2

Наиболее вероятной причиной этой ошибки является то, что проект стал коррумпированным. Вы должны декомпилировать, инструкции здесь: Отладить ошибочную ошибку соглашения о вызове DLL

Во-первых, убедитесь, что вы отключили имя Autocorrect: http://allenbrowne.com/bug-03.html и убедитесь, что у вас отсутствуют какие-либо ссылки.

Ответ 3

Я нашел полезное решение (в моем случае) для этой же проблемы в http://www.fmsinc.com/microsoftaccess/performance/decompile.asp. Это работало для меня как прелесть.
НТН
Фил

Ответ 4

Выполнение декомпиляции кода VBA и перекомпиляция с последующим уплотнением моей базы данных разрешили проблему для меня.

0 / 0 / 0

Регистрация: 03.02.2015

Сообщений: 1

1

03.02.2015, 17:21. Показов 4545. Ответов 2


Студворк — интернет-сервис помощи студентам

Добрый день. Подскажите пожалуйста:
Для кнопки закрытия форма прописал макрос — кнопка работает.
При повторном открытии базы — выдает ошибку «Renern without GoSub»
Подобные макросы в других формах этой базы работают.
При создании новой кнопки в этой форме- аналогично: до закрытия работает, после открытия базы по-новой — ошибка.

Заранее спасибо.

Миниатюры

Return without GoSub
 



0



alvk

Эксперт MS Access

7336 / 4476 / 289

Регистрация: 12.08.2011

Сообщений: 13,551

05.02.2015, 02:26

2

Visual Basic
1
2
3
4
if isnull(сума) then
  Dim A
  A = MsgBox("неподуюспик", , "Уважаемые")
end if

1.Макросы — тупиковая ветвь эволюции (с)
2.Поле сумма не должно ни при каких обстоятельствах принимать значение null, ни в каких проектах. Это решается ещё на этапе создания таблицы. Именно поэтому вы и создаёте потом свои костыли.



0



Андрэич

05.02.2015, 10:19


    Return without GoSub

Не по теме:

Какие красивые макросы в новых версиях Аксесс :)



0



  • Return to castle wolfenstein ошибка insufficient free disk space
  • Return to castle wolfenstein ошибка glw startopengl could not load opengl subsystem
  • Return to castle wolfenstein ошибка cannot open file for saving
  • Return outside function python ошибка
  • Return code 1612 hp ошибка