GoSub warning

T

Tammy

Hi - I have a database that keeps track of training sessions and attendees. I
have a main form that displays the name of the training session and a subform
that displays the list of attendees. I haven't had any problems at all with
the form until yesterday, and have used the form repeatedly in the past to
enter new attendees.

On the attendees subform there is a drop down list indicating attendee IDs
and their names. When a user makes a choice, the ID is stored in the field.
Yesterday, after selecting an attendee from the list I received the following
message:

"Object or class does not support the set of events."

After hitting OK, I was able to continue and did not see the message again.
The record saved properly.

Today, after selecting an attendee from the list, I received this warning:

"Return without GoSub."

After clicking OK, I can continue, but if the form is refreshed, the record
no longer displays on the form. (Whether I use the "refresh" button, or
whether I go to a different record on the main form and then return to the
record I was just viewing.)

I wasn't sure what it meant, so tried entering another record, but the same
message appears, and the record does not display after refreshing the form.

When I went into the table to enter the record there, all the records I
entered on the form appeared. So, the form is saving the record, just not
displaying it on the subform. After entering another record in the table, and
returning to the form, the record appears.

Now, I can no longer enter records through the form without getting the
warning. The only thing I can think of that I changed today was how the
drop-down list was sorting, but can't remember if I received the message
before or after changing the sort order of the drop-down list.

The field on the subform where the warning is now showing does have an
embedded macro attached to it, but that is just a MsgBox that will display a
message if a user enters an attendee ID that does not exist in the drop-down.
(In case they type an ID, instead of choosing from the drop down.)

Does anyone know why this warning is showing up all of the sudden, and what
it means? I am not a VBA user, so if it does have something to do with
programming, please use small words. :)

Please let me know if more info is needed.

Thanks for any suggestions on how I can correct my form.
 
D

Damon Heron

Is this an Access database? Does it have an mdb extension? Can you open
forms, etc. in design view? If yes, then open the form in design view and
right-click on the control that is giving you problems. Select properties,
and look at the event tab. Look for an event procedure, and click the
little button to the right of it. This should take you to the VB Editor
screen. Add a breakpoint at the beginning of the code for that control by
clicking in the grey area immediately to the left of the code. It should
highlight the line. Now go back to the Access screen, close the form and
run it. The code window will appear when you go to that control, and you
can step thru the code using the F8 key. If there is an error, it may go
immediately to that line of code. Report back if you have any luck!

Damon
 
T

Tammy

Hi Damon - thank you very much for your response. Yes, this is an Access
database - 2007, so the extension is .accdb.

There is an [Embedded Macro] attached to the "On Not In List" property of
the field that keeps giving me the GoSub warning. The macro alerts a user if
they type an ID that is not in the drop down list. Clicking the build [...]
button takes me to the macro window, not to Visual Basic.

I'm not sure if this is where the problem lies, as the GoSub warning appears
*after* making a selection from the drop down. So, the event that triggers
the [Embedded Macro] actually never runs (because I'm not typing in a value
that doesn't exist, I'm choosing a value from the list.). There is no "code"
associated with the field when I click the "View Code" button on the Ribbon.
(Again, I am not a VBA user, so I may not be looking exactly where needed.)

I'm not sure if this helps, but I have another form (separate from the form
I've been talking about) that does refresh my attendee subform (the form we
ARE talking about) after it's updated.

Here is the code for that event procedure (which is attached to the "After
Update" event on this separate form):

Private Sub Form_AfterUpdate()
Forms!frmTrainingSessionsAndAttendees!fsubEnterAttendeeToTraining.Form.Refresh
End Sub

The refresh of my subform only happens if a new attendee is created on this
separate form, so, the event procedure doesn't run if I'm just selecting
someone from my subform drop down list.

I'm just trying to think of all the possibilities that may be causing this
warning. Really would love to know why "all of the sudden" it's happening.

I checked my main form and subform, but neither have [Event Procedure]s
attached.

Any more suggestions? Thanks so much for taking the time to help me figure
this out.
 
L

Linq Adams via AccessMonster.com

From your description this sounds like some sort of corruption. I'd delete
then recreate the combobox that's apparently causing the problem.
 
T

Tammy

Hi Linq - thank you very much for answering my post.

I tried deleting just the field, and even went through the steps of the
Lookup Wizard for the field in my table, with no luck. So, I recreated the
subform from scratch, using a new source. Right now, the subform seems to be
working again! Thankfully, the subform was pretty basic, so recreating it
was not a problem.

Thanks, again, for your suggestion!

And, thanks, again to Damon!
 
L

Larry Daugherty

I don't know if it's related to your current problems but if the
"field" in question has anything to do with a LookupField in your
table then I suggest that you visit

www.mvps.org/access

and search for Lookup There is a note about the evils of Lookup
Fields in tables and it's recommended that you never use them. I'd go
there and read if you have a single LookupField in any table.

HTH
 

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