Error on opening database (1 Viewer)

SueKorrel

New member
Local time
Tomorrow, 06:38
Joined
May 14, 2021
Messages
9
Issue: I am getting an error message running macros unless I have opened the VBA window at the beginning of a session.
Details: My initial form on start-up (frmMySwitch) has two combo boxes and various command buttons. Most of the buttons use a macro to open another form. Two of them use VBA:
  • btnStatus saves the selection from cboStatus to openargs and opens frmChecklists. On open frmChecklists uses openargs to apply the appropriate status query.
  • btnContact filters frmChecklists by the contact ID in cboContact.
frmChecklists has a number of command buttons, all with macros, to open other forms, filtered by the selected record.
The issues:
  • All of the buttons on frmMySwitch work - they open the expected forms. btnContact filters frmChecklists as expected. btnStatus does not apply the query. The form opens to single record, and I can't see any logical reason for it's choice - it's not the first or last record. It's not the record last selected by btnContact.
  • The macro buttons on frmChecklist do not work. I get an error message "Object or class does not support the set of events".
  • If I open the VBA coding window - the errors all stop; btnStatus filters frmChecklists as expected, the command buttons on frmChecklists all work as expected.
Tried solutions: I've set enable all macros; the database is in a trusted location. I'm a little baffled, because it seems the issue is with frmChecklists. I'm not sure what opening the VBA window is turning on/off to reset the errors.
 

GinaWhipp

AWF VIP
Local time
Today, 16:38
Joined
Jun 21, 2011
Messages
5,809
Hmm, going to help if we have the exact wording of the error message, number and all, that you get when opening. As for frmChecklist need to know what those macros do.
 

SueKorrel

New member
Local time
Tomorrow, 06:38
Joined
May 14, 2021
Messages
9
The error message is "Object or class does not support the set of events" - no number, no other info, other than the database name in the header of the box. When I click that I get another box - Error number 2950, which I did Google - and that's why I changed the trusted location settings etc.
There are two macros directly on frmChecklists: on open - filter by the openargs from frmMySwitch, and on focus refresh. All other macros are on command buttons and they are all open another form, and I get the same message for all of them.
I've also noticed this morning, that an unbound text box I add to the form yesterday, that has an iif statement in it, comes up with "#Name?". But, again, once I open the VBA window - shows the expected text.
 

SueKorrel

New member
Local time
Tomorrow, 06:38
Joined
May 14, 2021
Messages
9
Second error box

1622072795259.png
 

SueKorrel

New member
Local time
Tomorrow, 06:38
Joined
May 14, 2021
Messages
9
Update - I just used the 'convert all macros to VBA' (which I didn't know existed until yesterday) and other than it mis-coding them all(!) it seems to have solved the error I was experiencing.
 

GinaWhipp

AWF VIP
Local time
Today, 16:38
Joined
Jun 21, 2011
Messages
5,809
Well, I guess I was typing too slow, though was not going to be my suggestion, I see you worked it out. I'll be moving along. :)
 

Users who are viewing this thread

Top Bottom