Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Undefined variable mystery

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rsosabusiness@aol.com - 04 May 2007 11:53 GMT
I have a one-record table (ControlFile) which I use to save totals and
other data to allow users to resume work after an interruption. Three
forms access this table. All three forms refer to this field in code.
All three find contain a text control bound to the field. I added a
new field to the table (AdditionalTitle). In all tree forms the code
stopped with the message 'Undefined variable.' After checking and
rechecking my spelling and struggling with the problem for a while, it
occurred to me to copy ControlFile and paste as ControlFileTest. I
changed the record source of one form to the new name and the problem
disappeared. I then renamed the original table as ControlFileOld,
renamed ControlFileTest to ControlFile, restored the record source for
the form to ControlFile and now all the forms work perfectly. Although
I found a solution, I'd like to know why the problem occurred in the
first place.
Cordially,
Robert
John W. Vinson - 04 May 2007 22:32 GMT
> I'd like to know why the problem occurred in the
>first place.

Changing the structure of a Table does not automatically change the SQL of all
queries - *including hidden queries created by Access as recordsources for
forms*.

You can fix this problem by opening the Form in design view, view its
Recordsource property, add the field, and close the query design window.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.