Question Access 2010 Control Wizard

Wow Gina - you are good. Never really got to grips with Binding. Just ran a Debug/Compile on the DB I attached in my last post and it is not generating and errors but I think from your comments I am missing something.

This database is only going to be used in 2010 so quite happy to standardise around that.

The only additional Objects it needs is Word for the Create Letter and Office for the FileBrowse. Yes - my comment lines said 12 but that was copied from previous db's; surely Word 14 and Office 14 will suffice.

So I am still a bit confused as what I need to do in this Access 2010 to fix the problem once and for all. Many thanks and hope you had a much better sleep than I did !!!
 
THANK YOU! Though without you mentioning Access 2007 I would still be crying!

Ahhh, I see by your comment it is the Word 12.0 Library that is the real issue. That Module you have for creating a letter needs to be changed to *Late Binding* instead of *Early Binding*. (To get the errors to pop-up just uncheck all the 12.0 Libraries in Access 2007. Open in Access 2010 and Debug > Compile, you should get errors. Now, you will get one at a time. As you rem out each Function it will move on to the next Function.

I would start by amending the Create Letter one to Late Binding and then Debug > Compile and if no more errors move along. If another error fix that to *Late Binging*. I would also remove those lines saying to check the 12.0 Object Library once you are done so you don't confuse yourself once you are done.

If you want some help with that... it's Saturday and I want to take my Mommy to the fair. :D So, if you can wait till later (maybe tomorrow) who knows how long I'll be with Mom, I can review and update.
 
Hi again; just unchecked all References, closed db, opened it, debug/compile and it produced the expected References error. Checked the appropriate ones (Word, Access Database Engine, Office) and then compiled again until nothing reported.

Then took a back-up copy and on that switched ON the Control Wizard and adding the button I mentioned earlier. Closed, reopened, pressed button and errorred straight away as has been the case previously. (NOTE last night's problem had this pesky wizard off as indeed it had been all day - so I am not convinced that the problem is entirely due to the wizard)

I don't think we have it yet. It seems that adding a new control, is the cause of the problem; which ofc ourse is exactly what i have been doing with additional forms, subforms and button. I have still a long way to go yet and Quotations need to become Jobs!!! This project is by no means finished.

Do you think you will be able to try the dbTEST I posted from this morning?
 
Okay, uncheck the References and do *not* check them back. Let Access define which References it needs. You'll notice they are fewer then what you had checked. The errors must be fixed without checking the References. Then try to add a button...
 
Okay, uncheck the References and do *not* check them back. Let Access define which References it needs. You'll notice they are fewer then what you had checked. The errors must be fixed without checking the References. Then try to add a button...


Aaah - so how do I fix the error without checking the Reference. Surely the Create Letter module requires the Word Object Library and similarly File Browse needs the Office Object Library - at least they have always done in 2003/2007.

I do have one less (the OLE one).

Or am I missing something really significant here and being rather dense?

In the past (v2003/v2007) I have always just checked the required Reference when I need to use that Object Library e.g. Word. Never had any problems. Is the 2010 Object Libraries somewhat different?
 
Last edited:
As I am walking out the door...

That module needs to be changed from Early Binding to Late Binding which I can do when I return but Mom is waiting to go.

And you may or may not need that OLE one, I will look later tonight (or tomorrow as Mom might be spending the night).
 
Enjoy your day; its 19:45 and I am 2 glasses of red wine in. Sunday is fine. I really appreciate your help.

If you can please, tell me: why does the Word need to be Late Binding when in 2003/2007 Early has been fine? Is it a 2010 thing?


PS: the code in the Create Letters module was lifted from the Wrox publication Access Programming 2007 p412 -421.

I have used it many times since. I have also used the Word Object model in a project I did for a client that involved a massive mail merge of different sections into different place in a template document. I have always declared the Object Model in the References 'early'.

This project is only ever going to be used on 2010. When I got into problems I was fortunate to be able to use my own (home) pc which has 2007 to try and get out of the lost data situation, which as we know worked. I really need to get back to 'trusting the software' to continue the design in 2010.

This morning I have been doing some research into Binding on the MSN site. The conclusion seems to be to use 'Early' wherever possible; so I am now even more confused.

I have even stripped in this code into the Letter Module to replace my original objWord declaration

Code:
  Dim objWord As Object

  Set objWord = CreateObject("Word.Application")

  objWord.Visible = True

and still it crashed when the Control Wizard was on and I created the previously described button.

Just to keep ourselves focussed, its the "Access Not Working" conflict that is the problem even though all my objects are referenced as 14.


Thanks Gina; Regards T
 
Last edited:
Gina - have you seen the post here entitled SP1 - Access 2010 . Do you think we both have the same problem?
 
Good morning

Just tried another 'Test' with all code a References relating to the Word Object Library removed and still the same error when placing a new button on a form.

Even tried replacing the Reference Office Access Database Engine with DAO 3.6. That made no difference either (BTW what is the difference between these two?)
 
Hi Gina - can you try this for me, please in Access 2010.

Open the attached and in Design view, make sure the Control Wizard in On and then add a button to the form F-Quotations. When the wizard starts, press Cancel. Then using the On Click event ellipsis, add this line of code

Code:
  Docmd.Openform "AF-Administrative Tools

Close the database and re-open.
Chose Quotations Summary (if you get that far!)
Double-Click the Quotation No. of any and then try pressing the new button when the form opens.

Even though all the Libraries are 14, this "Access has stopped working " comes up straight away on my pc.

This is exactly the problem I have been writing about and it would be interesting to rule out whether its my LapTop or something more fundamental.

Much appreciated. Thanks

Ted
Just to let you know, I was unable to replicate this error. In other words, when I clicked on the new button, the next form opened fine. I clicked cancel at the wizard as you said etc.

I have not changed anything in the download.

I'm running Access 2010 on Windows 7

Chris
 
Thanks Chris; that tends to suggest it my Lap Top that is the problem. Will endeavour to get an Access 2010 re-install.

It doesn't help yours of course but I appreciate the test. Will let you know what happens next.

Have a good day.

Ted
 
Okay, I am back, Mom spent the weekend!

@Chris... I was able to duplicate the error. Please check which References you checked.

@Ted... Okay, when you check the Reference to Word 12.0 it looks for Word 2007 and not finding it it causes issues. Late Binding says use whatever version of Word the End-User has.

Is the above section the code you are using now? Have you made sure the Reference Word 12.0 Library is unchecked?
 
Good morning Gina; I hope you had a good weekend.

Yes is the answer to your question but it seems to make no difference.

Yesterday I had our IT people re-install Office 2010 and again no difference. In each any every case, adding a simple button with a piece of OpenForm code causes the error.

I have even tried doing this on another database and same thing occurs. This leads me to conclude that the problem must be something to do with Access 2010 on this Windows 7 Pro pc.

In Access 2007 on other pc's everything is fine.

With your knowledge of Microsoft, is there any way we can determine what is causing the problem at system level.

I am getting close to putting back Office 2007 on this Lap Top as without a fix, I am dead in the water.
 
I run Access 2010 (and Access 2007) 32 bit on a Windows 7 64 bit and Windows 7 32 bit machine with no issues. And as soon as I removed those References can add a Command Button.

Have you removed the Reference and been able to successfully add a Command Button?
 
...Oops, I forgot!

Had a great weekend, Mom stayed longer then I thought but it's Mom you can't throw her out! :D
 
I have done so many things, not sure. Are you suggesting that you remove the References while in Design mode and then only put them back to test/run? Not tried that and its too late now as the 'IT boys' have it. Surely this shouldn't be necessary.

May I ask something, when you say remove the References, as soon as you Compile, it says it needs them and even with the Late Binding Code for Word, surely needs the Word Object library to run the object code.

What I can say, is that with the 2010 version, all references are 14, there are no 12's.

Anyway, our (University) IT people have kinda given up and we have now decided to go back to Office 2007. We feel that the problem is related to a driver in my 3 year old Dell M90 and for some reason we don't understand why that could be the cause.

I can reproduce the problem easy, in my prescribed way, even with a database that I designed 2 years ago.

They will have a brand new lap top with Win7 and Office 2010 in a couple of weeks - not for me, but I can test my apps there and see what happens so maybe keep an eye on this topic for the next chapter in this story.

I really appreciate the time and trouble you have gone too with this. Over and beyond the call of duty. If you were nearer I would .... anyway ... thank you again.. Watch this space - especially if the re-installed 2007 plays up ... Better Not!!!!!!!!!!!!
 
Yes, that is exactly what I am suggesting to remove the References. Of course do that on a copy (I also do for the oops event that could happen).

Then rewrite the code to use Late Binding and if when you Compile it is still asking for that Reference then the code need to be corrected still. In other words, correctly done Late Binding code will eliminate the Compile error and check the Reference when needed then uncheck when done. I only use Late Binding because I never know which version of Word (or any other Office application) the User will have.

I am going to fix the code later tonight (EST time here) and upload it later tonight. Then you can test that and let me know.

As for reproducing, I can do so 100 times so I have no doubt as to what you are saying. And I also know it's Late Binding vs. Early Binding issue and I want you to learn the difference... okay that part is my own hope, so that you learn to fish rather then my handing you the fish!

And thanks for the THANKS! No trouble, I'm just paying it forward... I was once you, asking questions figuring things out and now I can help someone else! Makes my day!

P.S. In my world *surrender* is not an option!
 
You are indeed a star so thank you for explaining it. I will be very interested in your Late Binding code and I look forward to receiving it.

Please see the msg in your private box.

I agree with your world but in this case, I have a client who requires their application on time and being late is not an option (in my world).

regards
T
 
Oh, well Client comes first... But at least you will have thee knowledge for future use AND when planning upgrades you can incorporate the Late Binding!

I have answered the PM!
 

Users who are viewing this thread

Back
Top Bottom