Home > database >  "Portfolio" of problems
"Portfolio" of problems

Time:10-03

Xiaodi bucai, just started learning PB. Make a phone call in the experiment of thin encountered a problem.
I want to make a combination query function, first built CBX -name and CBX - phone, then build the sle -name and sle - phone, finally built a "combination query" button.
But I can't figure out how to write this portfolio "button" (cb_multifilter) clicked feet???????
Simple question for you, but difficult to the younger brother I: (
Predecessors, please advise!

I have to be a piece of code, and is made of the function, there is an error, I hope you help me to check where is wrong.
Int n
String a1, a2
If cbx_name. Checked=true and cbx_tel. Checked=false then
N=1
The else
If cbx_name. Checked=false and cbx_tel. Checked=true then
N=2
The else
If cbx_name. Checked=true and cbx_tel. Checked=true then
N=3
The else
N=4
End the if
Choose a case n
Case 1
Dw_master_shop2. Setfilter (" name like '" + "% %" + sle_name. Text + "" +"' ")
Case 2
Dw_master_shop2. Setfilter (" tel like '" + "% %" + sle_tel. Text + "" +"' ")
Case 3
A1="(name like '" +" % % "+ sle_name. Text +" "+"') "
A2="(name like '" +" % % "+ sle_name. Text +" "+"') "
Dw_master_shop2. Setfilter (a1 + "and" + a2)
Case 4
Messagebox (" tip - ", "please select query conditions!" )
The end choose
Dw_master_shop2. Filter ()

CodePudding user response:

Cbx_tel should be cbx_phone

CodePudding user response:

- like this?
Dw_master_shop2. Setfilter (" name like '%' + sle_name. Text + "" + sle_name2. Text + % '")

CodePudding user response:

If the two fields?

Dw_master_shop2. Setfilter (" name1 like '% "+ sle_name1. Text +" %' and name2 like '% %' "+ sle_name2. Text +" ")

CodePudding user response:

I also want to know, thank you LZ.
  • Related