On Load event not firing. (1 Viewer)

John Sh

Member
Local time
Today, 23:26
Joined
Feb 8, 2021
Messages
410
I have a form with four active buttons that uses openargs to get information about the calling form.
Trouble is neither the load, open nor current events fire when the form opens resulting in "User defined type not defined" error when another button is clicked.
In the sample attached I have only put code behind the "Live Plant" button.
 

Attachments

  • Database3.accdb
    448 KB · Views: 72

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:26
Joined
Feb 28, 2001
Messages
27,186
Your sample doesn't have much code in it and I don't see where the multi-button form has those form events. The Open and Current events were definitely not implemented. I looked at it but I don't actually run someone else's DB on my machine. You DID have an autoexec macro, but macros don't run in form context. (They run in macro context.)

Given the words of your question and the dearth of content of your offering, I don't know how to analyze it. I think we need a little more than what you posted.
 

June7

AWF VIP
Local time
Today, 05:26
Joined
Mar 9, 2014
Messages
5,472
Did you Debug>Compile?

Typo error in: Private sOldTable As sttring

Fix that and get a new error: "Object doesn't support this property or method."

This code is not valid: sGenus = Forms(sOldTable).btnGenus
 
Last edited:

John Sh

Member
Local time
Today, 23:26
Joined
Feb 8, 2021
Messages
410
Given the words of your question and the dearth of content of your offering, I don't know how to analyze it. I think we need a little more than what you posted.
1) I put the autoexec macro in so the correct form would open first.
2) The second, Image, form is what it is, basically a simple menu and as such requires minimal code behind each button.

3) my problem is none of the normal form events trigger so the openargs data is not passed to the form and subsequent on click events.
 

John Sh

Member
Local time
Today, 23:26
Joined
Feb 8, 2021
Messages
410
1) I put the autoexec macro in so the correct form would open first.
2) The second, Image, form is what it is, basically a simple menu and as such requires minimal code behind each button.

3) my problem is none of the normal form events trigger so the openargs data is not passed to the form and subsequent on click events.
Did you Debug>Compile?

Typo error in: Private sOldTable As sttring

Fix that and get a new error: "Object doesn't support this property or method."

This code is not valid: sGenus = Forms(sOldTable).btnGenus
Thanks June7.
I turned the annoying auto error message thing off and missed the "sttring".
Debud->compile was quite happy with the "Forms" line.
All corrected and working as expected.
 

Users who are viewing this thread

Top Bottom