Custom XML ribbon not loading and Callback bombing out (1 Viewer)

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
I located a computer that has Access 2016 on it. I did what you did and get the same error. What references are you using?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
I located a computer that has Access 2016 on it. I did what you did and get the same error. What references are you using?
Just as a test, try the attached on that 2016 machine and let us know if you still get the same error, which was in the image you posted in Post #1.

1648059467089.png
 

Attachments

  • RibbonTest.zip
    31.6 KB · Views: 83

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
It worked! We were supposed to migrate to 2016, but there is a lot of code changes that I can't do on my own before our August deadline. I am too green.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
It worked! We were supposed to migrate to 2016, but there is a lot of code changes that I can't do on my own before our August deadline. I am too green.
Okay, now that we know it works with 2016, try testing that sample file on a 2013 machine but first fix the missing reference by replacing it with the 15.0 object library. You should see one of the references (the 16.0 object) marked as "MISSING" when you open the sample file on a 2013 machine.
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
I didn't see any real code in the module. How did the toolbar load? Very curious. I will let you know if the code works on the 2013 machine shortly.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
I didn't see any real code in the module. How did the toolbar load? Very curious. I will let you know if the code works on the 2013 machine shortly.
Well, just for this demo, I didn't load the entire module because it would require some updates due to the mix use of ADO and DAO code. At this point, we were just (or should I say "I was") trying to concentrate on the original error message you were asking about in your original question.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
Okay, it worked! What now?
Are you saying the original error message you posted in Post #1 is gone? If so, double check the Sub in your original db and make sure it is correct. I would suggest Compiling your Project, so you can fix any code error Access finds.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
Are you saying the original error message you posted in Post #1 is gone? If so, double check the Sub in your original db and make sure it is correct. I would suggest Compiling your Project, so you can fix any code error Access finds.
Another test you can do is replace the original Sub from your actual db with something very simple, like the one I used, just to see if the error goes away.
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
I didn't see any errors running the code you provided. I will attempt to try it in the original db. I still don't understand how the toolbar showed up with not code behidn it.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
I didn't see any errors running the code you provided. I will attempt to try it in the original db. I still don't understand how the toolbar showed up with not code behidn it.
To make the demo simple, and it's just for testing anyway, I only included the Sub for the FrmButtonPress. But, if you click on any of the Reports button, you will get the same error message.
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
Well, I put into my original db and my message is back. I have the correct references and I have compiled the database. No joy.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
Well, I put into my original db and my message is back. I have the correct references and I have compiled the database. No joy.
Unfortunately, the only other way we could help you at this point is to see your actual file. However, try what I said earlier and compile your project and fix any errors Access finds.
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
Thanks for your help. Do linked tables have to use dao?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
Thanks for your help. Do linked tables have to use dao?
You use either ADO or DAO depending on your needs. You can use either of them on linked tables. Why?
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
I finally have my toolbar loading. Unfortunately nothing works. The Public Function FrmButtonPress and RptButtonPress keep getting User-Defined type not defined error. I have been trying to research this issue, but nothing has worked. There is a lot of information out there! My references appear to be correct: Visual Basic For Applications, MS Access 15.0 Object Library, OLE Automation, MS ActiveX Data Objects 6.1 Library, MS Office 15.0 Access database engine object library, MS Excel 15.0 Object library, MS Word 15.0 Object library, MS VB for Applications Extensibility 5.3. Also, I am constantly being prompted for my DSN.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:52
Joined
Oct 29, 2018
Messages
21,467
I finally have my toolbar loading. Unfortunately nothing works. The Public Function FrmButtonPress and RptButtonPress keep getting User-Defined type not defined error. I have been trying to research this issue, but nothing has worked. There is a lot of information out there! My references appear to be correct: Visual Basic For Applications, MS Access 15.0 Object Library, OLE Automation, MS ActiveX Data Objects 6.1 Library, MS Office 15.0 Access database engine object library, MS Excel 15.0 Object library, MS Word 15.0 Object library, MS VB for Applications Extensibility 5.3. Also, I am constantly being prompted for my DSN.
Can you post an image showing the highlighted line?
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
Can you post an image showing the highlighted line?
'Callback for Form OnButtonPress
Public Function FrmButtonPress(ctl As IRibbonControl)

End Function
On Error GoTo FrmButtonPress_Err

DoCmd.OpenForm ctl.Tag

FrmButtonPress_Exit:
Exit Function

FrmButtonPress_Err:
MsgBox "Error:" & Err.Number & vbCrLf & Err.description, vbCritical, "Warning"
Resume FrmButtonPress_Exit

End Function
 

equus

Member
Local time
Today, 04:52
Joined
Mar 22, 2022
Messages
31
Attached is copy of the actual error message.
 

Attachments

  • Access Error.jpg
    Access Error.jpg
    71.3 KB · Views: 59

Users who are viewing this thread

Top Bottom