Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Linked Table in MS Access shows prior data
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 t
he 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 ne
w data the new data is displayed.

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

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

Help

Report this thread to moderator Post Follow-up to this message
Old Post
donaldmaloney
05-11-05 02:46 AM


Re: Linked Table in MS Access shows prior data
quote:
Originally posted by 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 t he 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 ne w data the new data is displayed. If I get out of the form and come back in without changing the code the subf orm 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 S QL "SELECT" statement. Then .requery and .refresh will work. OMR

Report this thread to moderator Post Follow-up to this message
Old Post
OldManRiver
09-08-05 03:09 PM


Re: Re: Linked Table in MS Access shows prior data
Actually what was necessary was to put in code at the start of the ON change
 event whih deleted table links,  reset new table links and requeried the su
bform.

Me.NAMEOFSUBFORM.SourceObject = ""
Which pulls the subform link off of the main form
Then I delete table links ,which create the query to the subform.
Then I link to the tables referencing the correct files.

Then use the statement 
Me.NAMEOFSUBFORM.SourceObject = "NAMEOFSUBFORM"
Which on requery now uses the correct tables and the subform displays correc
tly.

What I think was happening is Access when it opens a form or subform with a 
recordsource  saves that recordsource as a clone table.
With the reseting of the name to blank and top itself the clone Table goes a
way and on requery a new one is created.

At least this works for me.

B][/QUOTE]

Report this thread to moderator Post Follow-up to this message
Old Post
donaldmaloney
09-17-06 08:52 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:48 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.