Share via

Access UPDATE Query with Multi-valued Field

Anonymous
2016-06-15T19:13:19+00:00

Hello Community,

I am trying to import data from an Excel document into an Access database.  I imported the Excel document into a table.  Database is for retirement home residency application.  In the Excel document table, there is a single true/false column for each tower selection (6 in total), but in the database table I want to use I have a single lookup field for selecting the towers from a tower field.  

I would like to run a simple query that checks which of the excel document table columns are set to true, then updates the tower field in the other table to include that selection.  However that results in the error "An UPDATE or DELETE query cannot contain a multi-valued field."

Basically I just need to know if there is a quick way I can import the tower selections from the excel document table so that I don't have to go through each of the 958 records selecting which towers they have applied for.  Using true/false fields for each tower would mean altering all of my queries, forms, and reports; plus that would take up more space in the already crammed reports.

Thanks.

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

4 answers

Sort by: Most helpful
  1. Anonymous
    2016-06-16T19:44:44+00:00

    "INSERT INTO tblWaitingList (Tower.Value) SELECT TT1 FROM excelstuff WHERE ID = ApplicantID"

    Does that look correct?

    Seems to me it's attempting to select the boolean value from the tower field and insert it into the MVF.  Perhaps I didn't explain the situation well enough.  Thanks for your help though!

    Was this answer helpful?

    0 comments No comments
  2. DBG 11,711 Reputation points Volunteer Moderator
    2016-06-16T18:58:17+00:00

    Hi. Did you try the SQL I posted earlier? It should work provided you use the correct field names.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-06-16T18:42:33+00:00

    Thanks for the response.  Where I'm stuck is in that demo you moved the values from one MVF to another, but I need to set the MVF values for each record based on a non-MVF.  

    In the INSERT statement values where you have "('" & !NewMVF & "')" I think I need to manually input the values (tower id's) like this: "(1,2,3,4)." I tried it, and there weren't any errors but it didn't work.

    It seems like the answer is probably there but I just lack the knowledge and expertise to extrapolate it.

    Was this answer helpful?

    0 comments No comments
  4. DBG 11,711 Reputation points Volunteer Moderator
    2016-06-15T19:33:12+00:00

    Hi. You can use an INSERT statement to add the Towers to the MVF, but you'll have to do it for each record.

    INSERT INTO TableName (FieldName.Value) SELECT Tower FROM OtherTable WHERE FKID=PKID

    See if this demo can give you some ideas. Hope it helps...

    Was this answer helpful?

    0 comments No comments