Selecting and Modifying Form Controls in VB.NET 1.1 -- Urgent

J

JustinL

Hello,

I was tasked to do work on an existing application written in VB.NET 1.1
which uses an Access 2000 database for reporting. The application sets
values on an Access form and then the calls Access Reports which use the form
values to query the database and create the report. Like this:

appAccess.Forms("frmCriteria").Controls("strReportTitle").Text = "My Report"

appAccess.DoCmd.OpenReport("rptPersonInfo", Access.AcView.acNormal)

This worked just fine up until a few days ago when I "upgraded" from Office
2003 to Office 2007. The lines of code which access and modify the form
control fields no longer work and throw null reference errors. I reinstalled
Office 2003 and made sure that all of my office assembly references were for
Office 11.0, but that hasn't made a difference. I have been looking around
MSDN for an alternate way to do this but the documentation for the Office
Interop stuff is terrible.

Can anyone help with this? In a nutshell, how do I change form fields
programatically from the Access.Application class?

Thanks,
Justin
 
M

Michel Walsh

Maybe your open Access application is open in a read only mode, a new
security feature, and thus, does not accept the modification (assuming the
line of code is from Dot Net 1.1) :

appAccess.Forms("frmCriteria").Controls("strReportTitle").Text = "My
Report"



Can be something else, too, since I don't use Access Automation under Dot
Net.



Vanderghast, Access MVP
 

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