amyxkatexx
New member
- Local time
- Today, 06:34
- Joined
- Jun 2, 2010
- Messages
- 4
Okay, so I am VERY new to Access and as a matter of fact, I don't even have it installed on my computer and only have limited access to a computer that does have it, so I do all my research beforehand so as to not waste time. This makes things rather difficult to "test" while I am finding answers online.
Basically what I know (and this may be wrong) is that someone has set up a table that is directly linked to the company's database. I then import an excel spreadsheet of my own as a table and then link it accordingly to the table so I can output data from the database that is not on the spreadsheet.
This works great except for one thing. One of the fields I am trying to get out of our database may have several values per item. I only care about 3 of these values, 883, 879, and 884. It is possible that one item may have all 3 of these values, but unlikely. In that situation, I would prefer it either output each one or if possible only one with the hierarchy being 883, 879, 884.
What I have done thus far is place "883 or 879 or 884" in the criteria section but the problem with this, is it only returns items that have these values and not ones that do not have any value or have a different value.
Basically, what I want is an an if-then statement like this:
If
[ListKey] = 883 Then
result = "883"
Else If
[ListKey] = 879 Then
result = "879"
Else If
[ListKey] = 884 Then
result = "884"
Else
result = ""
End If
How would that be written and where would I put it for it to work as I am intending without using macros.
Thanks in advance!
-Amy Kate
Basically what I know (and this may be wrong) is that someone has set up a table that is directly linked to the company's database. I then import an excel spreadsheet of my own as a table and then link it accordingly to the table so I can output data from the database that is not on the spreadsheet.
This works great except for one thing. One of the fields I am trying to get out of our database may have several values per item. I only care about 3 of these values, 883, 879, and 884. It is possible that one item may have all 3 of these values, but unlikely. In that situation, I would prefer it either output each one or if possible only one with the hierarchy being 883, 879, 884.
What I have done thus far is place "883 or 879 or 884" in the criteria section but the problem with this, is it only returns items that have these values and not ones that do not have any value or have a different value.
Basically, what I want is an an if-then statement like this:
If
[ListKey] = 883 Then
result = "883"
Else If
[ListKey] = 879 Then
result = "879"
Else If
[ListKey] = 884 Then
result = "884"
Else
result = ""
End If
How would that be written and where would I put it for it to work as I am intending without using macros.
Thanks in advance!
-Amy Kate