sweensterpng
New member
- Local time
- Yesterday, 20:03
- Joined
- May 2, 2006
- Messages
- 7
I am building a form that will generate quotes for security sytems by allowing you to select inventory items from a combo box, then simply adjusting the number of that item needed. I have needed to make it so you can enter in items and prices that are not in the inventory. What I need to do now, however, is lock the price field if the item does exist in the inventory. Here's the code I've been using in the Current event of the form:
If DCount("[Item]", "tbItems", "[Item] = " & Chr(34) & Me![Item] & Chr(34)) = 0 Then
Me![Price].Locked = False
Else
Me![Price].Locked = True
End If
This doesn't seem to do anything at all. I tried changing the code just to generate a message box, in order to see if the DCount function was doing the trick, and it does seem to be identifying whether or not the item exists in the inventory. I have no idea why this wouldn't work.
If DCount("[Item]", "tbItems", "[Item] = " & Chr(34) & Me![Item] & Chr(34)) = 0 Then
Me![Price].Locked = False
Else
Me![Price].Locked = True
End If
This doesn't seem to do anything at all. I tried changing the code just to generate a message box, in order to see if the DCount function was doing the trick, and it does seem to be identifying whether or not the item exists in the inventory. I have no idea why this wouldn't work.