Check box depending on value of text box

JiTS

Ciao!
Local time
Today, 23:48
Joined
Dec 12, 2003
Messages
77
Hi,

Problemsituation (see attachment):
I have a report with a couple of text boxes and one checkbox.

Question:
I want that the checkbox checks if the field (productcode) the text "VB" contains. If so then the checkbox will be checked (true).

Own solution until so far:
I added the following code to the controlcource of the checkbox:

=IIf([txtProductcode]="VB0102";True;False)

The check box will be checked if the productcode is "VB0102".
This works fine, but I want that it also works for the criteria "VB". It's something with the function "Like" I guess.

Please help,

JiTS
 

Attachments

  • problemsituation.jpg
    problemsituation.jpg
    6 KB · Views: 163
=IIf(InStr(1, [txtProductcode]"VB";True;False)
 
Mile-O-Phile,

Thank you very much... you are a genius! ;)


*SMiLE*
JiTS :D
 
I am having this same problem but unfortunetely I can not get it to work.

I have a data field (status) that is either Graduated, Terminated, or Current. I also have a report that has a check box representing each (such as a check box for graduated and another for Terminated etc).

I am trying to get the report to read the status and check the appropriate box in the report.

I have tried this in the control source of the checkbox
=IIf([status]="terminated";True;False)
but this does not work

I have also tried this on the OnOpen

If [status] = "terminated" then
termcheck = true
else
termcheck = false
end if
end sub

But this does not work either - what am I doing wrong :confused:
 

Users who are viewing this thread

Back
Top Bottom