View Full Version : Can't save row source on linked table
werafa
05-02-2017, 04:52 AM
Hi,
I've got a linked table from another access file that has two fields with lookup tables.
the original table has row source = SELECT Offices.[ID], Offices.[Location] FROM Offices;
When I open the linked table the row source is missing.
I can add it, and the values populate the linked table correctly
but the row source is lost when I close and re-open the table.
Is this behavior normal, and what is the best way to fix it?
thanks
HiTechCoach
05-02-2017, 09:42 PM
Yes, unfortunately, it is normal behavior of the [buggy] lookup field in tables.
Delete the lookups from the table's field design.
This is another one of the reasons I never used them. Many, including myself, consider them Evil.
See: The Evils of Lookup field in tables (http://hitechcoach.com/microsoft-office/access/access-links/50-access-tables-tips-and-tricks/582-the-evils-of-lookup-fields-in-tables)
werafa
05-03-2017, 01:04 AM
Thanks. behind my ears hasn't dried yet.
Is there another way to force users to use only values from another table in this field?
I suppose I could use VBA - but this seems a little heavy handed
Werafa
HiTechCoach
05-03-2017, 11:10 AM
Are you asking about how to prevent this for databases where other poeple are creating the tables?
werafa
05-04-2017, 01:43 AM
No.
I merely want to prevent typos from creating new categories
HiTechCoach
05-04-2017, 08:58 AM
I would assume you are using a form with a combo box. If yes, then try setting the combo box's Limit to list property to True/Yes.
cleteh
05-04-2017, 12:42 PM
I had a similar issue. I first built a view in SQL Server called OpenAuditInstanceInternal and linked it. I then set a variable equal to the records in my view. I then set the rowsource equal to the results of the view stored in the variable sSQL.
This code is inserted into the ON Load Event for the form.
sSql = "select * from OpenAuditInstanceInternal"
lstAuditInstance.RowSource = sSql
lstAuditInstance.Requery
werafa
05-04-2017, 03:20 PM
I had set it up as a table with the lookup in the table.
Have learned that his is bad practice :(
HiTechCoach
05-05-2017, 02:26 PM
I had set it up as a table with the lookup in the table.
Have learned that his is bad practice :(
It is a Best Practice to only let users view forms when working with data in tables. Not queries or tables directly. Tables and queries look very much like an Excel spreadsheet. Which makes it very tempting to use. Avoid the urge to protect your data.
What makes Access a great tool for data entry is the power of bound forms.
werafa
05-05-2017, 03:05 PM
Thanks Boyd,
I learned something today :)
HiTechCoach
05-05-2017, 04:11 PM
You're welcome.
Glad we could assist.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.