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 / Modules / DAO / VBA / September 2007

Tip: Looking for answers? Try searching our database.

Code bombs if I update it to reflect field name changes.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FredFred - 15 Sep 2007 00:00 GMT
I'm old to Access and new to access programming.

An event procedure never seems to recognize the new names of renamed fields.
In fact, it does recognize and access renamed fields by their previous
names.   (So, this isn't the usual error of failing to update the code to
reflect field name changes, it's sort of the opposite)  

For example, lets say I change a field name in the table from FieldA to
FieldB.  If I update it's call in the code from FieldA to FieldB, it errors
out saying "can't find field".  But if I use the previous  (now gone)
"FieldA" field name in the code it accesses the field just fine.  

Using Access 2003.
Douglas J. Steele - 15 Sep 2007 13:21 GMT
I suspect that your form is based on a query, and you haven't updated the
query to reflect the changes to the table.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> I'm old to Access and new to access programming.
>
[quoted text clipped - 11 lines]
>
> Using Access 2003.
FredFred - 17 Sep 2007 19:20 GMT
Dear Doug,

Thanks for the idea.   But the report came directly from the table.    But
your answer helps me focus on where I need to look harder and experiment
more.   Now I can't seem to replicate the behaviour that I was sure I
established.   A new variable is that if I have a second use of that field in
the same section it seems to see it, and if not, not.  

Thanks again.  

Sincerely,

Fred
 



> I suspect that your form is based on a query, and you haven't updated the
> query to reflect the changes to the table.
[quoted text clipped - 14 lines]
> >
> > Using Access 2003.
FredFred - 17 Sep 2007 19:44 GMT
Doug,

Further to my last post I experimented more.   I'm trying to put code in the
"on format" in a report detail section. to make an image box show the image  
pointed to by the pat in a field.   I misunderstood what was happening.  My
code NEVER sees the field, except that having  unless I have a second use of
the field in that section, it was able to see it.  And through autocorrect or
something, that other control was serving as a translater / link.  So, now I
know what was happenning but not how to make code see a field.  A newbie
error I'm sure.

Fred


> I suspect that your form is based on a query, and you haven't updated the
> query to reflect the changes to the table.
[quoted text clipped - 14 lines]
> >
> > Using Access 2003.
Rick Brandt - 17 Sep 2007 20:59 GMT
> Doug,
>
[quoted text clipped - 7 lines]
> happenning but not how to make code see a field.  A newbie error I'm
> sure.

A quirk of Access reports.  Even though they are in the RecordSource you
cannot refer to a field unless it is used as a ControlSource somewhere in
the report.  I just add TextBoxes that use them as ControlSources and then
set them to not be visible.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

 
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



©2008 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.