Cannot add new item to list

Anonymous
2019-12-05T04:03:45+00:00

Hi guys,

OK I have been using the bundled database "Asset Tracking" to keep track of one of my collections. I have an Office 365 Home subscription. I've been successfully using this for a few months and currently have over 500 assets in the database.

As I add a new item to this database there is a field called "location". Every time I add a new location that's not already in the list it asks me if I want to add it, I say "yes", then I add it and go about my merry way.

This no longer works. 

Now when I type in the new list item and hit TAB (as I've done 100 times before) when I get to the point where I click on OK it tells me again that the location is not in the list and do I want to add it? 

So let's say that I just added "Belfast" it shows me the list of locations that are already in the list with Belfast at the bottom, then just above it is an entry called "B". Nothing I do will let me actually successfully add a new Location. I delete Belfast and B from the list (by dropping down the list, right clicking and select "edit list items") which does seem to delete both items, but when I go to add it again the exact same thing happens. I have a the same issue no matter which city I try to add so it's not a B or a Belfast thing. 

Tech support won't help me and my database is now useless if I can't keep adding new locations to choose from when adding assets. 

I've tried "Compact and Repair Database" to no avail. Tech support via chat was useless and suggested I try an online repair which just downloaded and reinstalled the program. This hasn't helped. Same problem. It seems the location field has somehow gotten corrupted.

Any help would be greatly appreciated!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

44 answers

Sort by: Oldest
  1. Anonymous
    2019-12-05T21:11:18+00:00

    Obviously I'll need to first create a separate table for "sold items" then add another control on this table to move something from this table to the newly created table.

    No.  That would be 'encoding data as a table name'.  A fundamental principle of the database relational model is the Information Principle (Codd's Rule #1). This requires that all data be stored as values at column positions in rows in tables, and in no other way.  You should have a single Assets table which includes a Sold column of Bolean (Yes/No) data type.  To return all current assets you use a query restricted to:  WHERE NOT Sold, and to return sold assets you use a query restricted to WHERE Sold.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,840 Reputation points Volunteer Moderator
    2019-12-06T00:44:30+00:00

    What Ken said, there is absolutely no need to remove items from the Items table. All you should be doing is added a date sold field to the Items table (Maybe a price paid field as well). Then you can filter for records where the Price is or isn't null.

    An alternative is to have a transactions table. These transactions will have the ItemID as a foreign key and the transaction info (date sold, price, sold to, etc.) Then you can create a Not In query (see Query Wizard) which will only list Items not in the Transactions table.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-12-06T09:01:37+00:00

    Thanks Scottgem, you are the man! Great instructions! ;)

    After fiddling with my database for about 90 minutes I seem to have it mostly working. However I have to leave the newly created locations table open as a separate tab and add new locations to it as needed. What's strange is (I'm going to try to articulate this in a way that you can grasp my meaning) that once I add a new location to my location table I can choose it from the "Asset List" table, but if I click on "open" in the Asset List table to edit an existing record, if I drop down the location box from the "Asset Details" form it is still referencing the old valuelist data and not looking at the data in my new "locations" table, so I have to figure out where to change this data again. The screenshot just below is where it is NOT working properly: (notice the locations are not in alphabetical order, that's another way that I know it's pulling the data from the valuelist, not my new table)

    https://learn-attachment.microsoft.com/api/attachments/b4ec4f67-22d5-43a5-bc49-5f3a51e0cb32?platform=QnA

    Below you will see a screenshot of the main "Asset List" table where everything seems to be working (it looks at the data in my new table, notice the locations are also in alphabetical order) Clicking on "open" in the left column brings up the "Asset Details" form shown above.

    I've clicked on "Asset Details" in the left most "Assets Navigation" area hoping this is where I go to get the non-working "Asset Details" table to work like the "Asset List" table but it's not what I'm looking for.

    Anyway, I hope all of this makes sense. Right now I have a workable solution (thanks to you) but if I can at least get the "Asset Details" form to look at the new "locations" table like the "Asset List" form does I will be golden. Of course not having to switch to the "locations" table tab to add a new location would also be helpful but not an absolute necessity. I tried using the code from the link you provided (in their 3rd example) but it didn't seem to work. Thanks a million for your help! :)

    Was this answer helpful?

    0 comments No comments
  4. ScottGem 68,840 Reputation points Volunteer Moderator
    2019-12-06T12:29:05+00:00

    Where did you change the parameters of the combobox? It looks like you may have changed them in Table Design mode, rather than Form Design mode. When a form is created from a table, it copies the characteristics of the fields from the table, but they are no longer linked. So if you made the changes in the table, then they won't be reflected in the Form. 

    The template almost definitely used the Lookup Field feature on the table level. Most pro developers shun this feature for several reasons. One reason is that it does not provide a NotInList event that both Ken and I talked about. If you properly code the NotInList event on the form, then there is no need to keep the Locations table open. The code will detect that the new location is not in the list and prompt you if you want to add it.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-12-06T22:32:03+00:00

    Hi again Scottgem,

    Well I'm getting closer! Now both forms pull from the "locations' table. However my "code" doesn't appear to be working because it tells me my choice isn't in the list and that I need to either choose an item from the list or type something that equals an item in the list. So I went into the "locations" table and added the new location. Closed my form and went back into it and now my new location is selectable. So it's not prompting me if I want to add a new location. No biggy but sure would be convenient if it works. And while I took a class in Junior college 5 years ago in VB programming it was a very tough course for me so I'm not sure I can figure out what's wrong. I basically copied and pasted from the website you gave me. 

    I'll also try to figure out the "sold" items issue with you guys help. Thanks to both you and Ken for taking the time to help me customize this database to meet my needs. It's greatly appreciated!!

    Was this answer helpful?

    0 comments No comments