Home All Groups Group Topic Archive Search About

Linked Table in MS Access shows prior data

Author
11 May 2005 2:46 AM
donaldmaloney
In MS access I have a form that I select a code.
Depending on th ecode The subform displays the data in the table.
When I change the code  I un link the old table with a Docmd call and link the new table with a Docmd call.

The subform shows the data from the first table.
but if I look at the Tables page and click on the table that links to the new data the new data is displayed.

If I get out of the form and come back in without changing the code the subform now shows the correct data.

I have done .requery and .refresh but that doesnt solve the problem.

Help -- donaldmaloney ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------

Author
8 Sep 2005 3:09 PM
OldManRiver
donaldmaloney wrote:
> *In MS access I have a form that I select a code.
> Depending on th ecode The subform displays the data in the table.
> When I change the code  I un link the old table with a Docmd call and > link the new table with a Docmd call.
>
> The subform shows the data from the first table.
> but if I look at the Tables page and click on the table that links to > the new data the new data is displayed.
>
> If I get out of the form and come back in without changing the code > the subform now shows the correct data.
>
> I have done .requery and .refresh but that doesnt solve the problem.
>
> Help *

The unlink/relink is not important or necessary.  What is necessary is:

me.recordsource = SQLstatement

where SQLstatment shows the actual data you want to see on the form from a SQL "SELECT" statement.

Then .requery and .refresh will work.

OMR -- OldManRiver ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------

AddThis Social Bookmark Button