Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why won't my Excel formular work in Access?

Posted on 2014-09-23
6
Medium Priority
?
280 Views
Last Modified: 2014-09-29
Confirm Colum equals value and if yes
insert contents from another column eg CS-CV-A-0040 less the A

=IF([Check]="Confined Space",CONCATENATE(LEFT([Confined Space Audit Number,6]),RIGHT([Confined Space Audit Number,4])),"")
This is the data base formular which I cant get to run
=IF(G2="Yes",CONCATENATE(LEFT(B2,6),RIGHT(B2,4)),"")
This is the formular which works in excel
What have I done wrong
0
Comment
Question by:James Clements
6 Comments
 
LVL 14

Expert Comment

by:Don Thomson
ID: 40340707
I would try it with the proper syntax  

IIf («expr», «truepart», «falsepart»)

Which version of Access are your using?

Not the two "I" s


IIF(G2="Yes",LEFT(B2,6)&RIGHT(B2,4)),"")

Also Concatenate is not valid in Access (at least up to Vers 2007
0
 
LVL 85
ID: 40341203
How are you running this in Access? Are you automating Excel from Access and using this, or are you trying to do this directly in Access?
0
 
LVL 40

Expert Comment

by:PatHartman
ID: 40341602
If you don't use embedded spaces and special characters which force you to encase the name in square brackets, you will have fewer opportunities for typos.

=IF([Check]="Confined Space",CONCATENATE(LEFT([Confined Space Audit Number],6),RIGHT([Confined Space Audit Number],4)),"")

You had the ending square brackets in the wrong place.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:James Clements
ID: 40343219
Still unable to run formular in MS Access 2010
1 [Check] column is "Confine Space" if not leave blank
2 IF true
3 Generate number form column [Confine Space Audit Number} eg CS-CV-A-0040
4 Remove the A from [Confine Space Audit Number} eg CS-CV-0040

This what I am trying to achieve should CONCATENATE work
0
 
LVL 40

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 40344240
Still unable to run formular in MS Access 2010
What does that mean?  Are you getting an error message?  What is it?  Are you getting the wrong result?  What are the ALL the inputs and what are you ending up with?  Paste the exact code that is failing.
0
 

Author Closing Comment

by:James Clements
ID: 40351108
I had a spelling mistake in 1 of my columns thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question