J
JB
I have a query regarding Access programming. I do not
know whether it is a simple or a difficult query.
I have a form which uses a text box by the name 'rate'.
There is combo box 'Customer ID' and 'Description' text
box. I want the rate box to display the value after
evaluating the Customer ID box and the description box.
If I write the word 'nylon' in the description box, it
should take one value and if I write the word 'zinc' in
the description box, it should take the value from the
table. The code that I have written in the afterevent
procedure of the description box is as under:
Private Sub Description_AfterUpdate()
If Forms![Challans]![Subform]!Description = "*nylon*"
Then
Me!Rate = "1.9"
ElseIf Forms![Challans]![Subform]!Description
= "*zinc*" Then
Me!Rate = DLookup
("[Rate]", "Customers", "[CustomerID]=" _
& Forms![Challans]!CustomerID)
Else
Me!Rate = ""
End If
End Sub
The problem is that it just does not catch nylon or zinc.
Like if I write "1 nylon plate of Crest" in the
description column, it should give the answer as true in
the first place. Can you help?
know whether it is a simple or a difficult query.
I have a form which uses a text box by the name 'rate'.
There is combo box 'Customer ID' and 'Description' text
box. I want the rate box to display the value after
evaluating the Customer ID box and the description box.
If I write the word 'nylon' in the description box, it
should take one value and if I write the word 'zinc' in
the description box, it should take the value from the
table. The code that I have written in the afterevent
procedure of the description box is as under:
Private Sub Description_AfterUpdate()
If Forms![Challans]![Subform]!Description = "*nylon*"
Then
Me!Rate = "1.9"
ElseIf Forms![Challans]![Subform]!Description
= "*zinc*" Then
Me!Rate = DLookup
("[Rate]", "Customers", "[CustomerID]=" _
& Forms![Challans]!CustomerID)
Else
Me!Rate = ""
End If
End Sub
The problem is that it just does not catch nylon or zinc.
Like if I write "1 nylon plate of Crest" in the
description column, it should give the answer as true in
the first place. Can you help?