Lemmy Winks
Registered User.
- Local time
- Today, 04:00
- Joined
- May 31, 2011
- Messages
- 10
Hi, im developing a database. I have a form with several combo boxes on it that drop down to display options. What im working on now is a combo box with serial numbers for items. I want to display a report for all items, all items with a serial number, and a specific item chosen from the combo box with the chosen serial number. Problem is alot of items dont have serial numbers, so the fields are null. As you can see in my function in the query you have the FAS (serial number), and if that is the option in the combo box then the FAS field in the query will contain all the FAS values from the main table. Access leaves out all the rows with null vales in the field automatically, which makes things convient for the FAS only query, but causes a problem during my ALL query for all records in the database. You can see i have [XRAY - Main]![FAS] Or Is Null down for the ALL "True" value, and this works to get all records with and without a FAS number if i plug it striaght into criteria, but it does nothing in the function, becasue it itself is techniqually not a value. Ive tried putting it outside of this Iff function as seen below the first line of code, and it works for FAS and single serials but still not for ALL. Is there anything i can do to make this work? I basically need something that will select all values null or not in the FAS field, but i cant find anything that does that, i know in SQL you can just type * to get that but not here.I also have another thing im working on dunno if it could go anywhere, any help be appreciated. Also im thinking of making a custom function to do this, but cant find the existing Iff function anywhere to copy/learn from that code.
IIf([Forms]![testformLB]![FAS CB]=" ALL",[XRAY - Main]![FAS] Or Is Null,IIf([Forms]![testformLB]![FAS CB]=" FAS",[XRAY - Main]![FAS],[Forms]![testformLB]![FAS CB]))
([XRAY - Main]![FAS] Or Is Null) And IIf([Forms]![testformLB]![FAS CB]=" FAS",[XRAY - Main]![FAS],[Forms]![testformLB]![FAS CB])
([XRAY - Main]![FAS] Or Is Null) And IIf([Forms]![testformLB]![FAS CB]=" FAS",[XRAY - Main]![FAS],IIf([Forms]![testformLB]![FAS CB]<>" FAS",[Forms]![testformLB]![FAS CB]))
IIf([Forms]![testformLB]![FAS CB]=" ALL",[XRAY - Main]![FAS] Or Is Null,IIf([Forms]![testformLB]![FAS CB]=" FAS",[XRAY - Main]![FAS],[Forms]![testformLB]![FAS CB]))
([XRAY - Main]![FAS] Or Is Null) And IIf([Forms]![testformLB]![FAS CB]=" FAS",[XRAY - Main]![FAS],[Forms]![testformLB]![FAS CB])
([XRAY - Main]![FAS] Or Is Null) And IIf([Forms]![testformLB]![FAS CB]=" FAS",[XRAY - Main]![FAS],IIf([Forms]![testformLB]![FAS CB]<>" FAS",[Forms]![testformLB]![FAS CB]))
Last edited: