The problem I'm having is that Access doesn't like me comparing the value of a textbox to the value in one of my tables. I'll list everything because its small and I can explain things easier.
3 Tables:
1) "Properties". Headers "ID", "Property". Indexed values of "Mascara", "Foundation", "Nails"
2) "ICs". Headers "IC", "Property_FK". Indexed values for "IC" of the numbers 1-5 as numbers. 1 and 2 are mascara, 3 and 4 are foundation, 5 is nails. Property_FK is in a relationship with property from "Properties" (combobox dlookup for values). [IC = Item Code]
3) "pH Test". Headers "Property_FK", "pH". Again property is pulled directly from the properties table. pH column is a yes/no box. values can be whatever, for this test I had mascara and foundation as yes's.
1 Form:
1) "Login".
"cbIC". Combobox that pulls values from "ICs" to list the Item Codes.
"tbProp". Textbox that pulls Property from "ICs" using the IC as a lookup.
"tbPH". Textbox that will display an "X" if the box is checked in pH test.
The combobox and textbox work fine. As I change selections in the combobox the property box updates accordingly. The problem is getting the tbPH box to work.
Code:
If(DLookUp("[pH]", "pH Test", "[Property_FK]="& "[tbPH].[Value]","X","")
is the closest thing that I have gotten to work. The problem is that it is not updating as new ICs are selected, it is just sticking with the initial value and not changing. I've made a test textbox and [tbPH].[Value] works and updates as necessary. The problem is that in the DLookUp function if I drop the quotes around tb.value I get an error. So I'm not entirely sure what syntax I need to get it right or if I need to store my data in a different format to make the comparison work like I want it to.
Any help would be appreciated!
Thanks,
-Matt