Hi Tech Gurus,
My requirement is user should select his column headers from combo box. The database has 26 columns, user will be select 2 columns (from 2 combo boxes). I have made the string for select but when I execute it its not selecting the data as what's in those column. Its only populating the values of selection. Example: if I have selected 201404 & 201406 then its now showing data in it.
My select string is:
strsql = "Select id,code,"
strsql = strsql + "'" & cmbpayperiod.text & "'"
strsql = strsql + "'" "," "'"
strsql = strsql + "'" & CmbPp.Text & "'"
strsql = strsql + " from Tdata where payroll_code='" & CmbMrc.Text & "'"
Line 2 & 4 are my combo boxes.
now how to get the values for these columns. are thr any syntax error ?
My requirement is user should select his column headers from combo box. The database has 26 columns, user will be select 2 columns (from 2 combo boxes). I have made the string for select but when I execute it its not selecting the data as what's in those column. Its only populating the values of selection. Example: if I have selected 201404 & 201406 then its now showing data in it.
My select string is:
Quote:
strsql = "Select id,code,"
strsql = strsql + "'" & cmbpayperiod.text & "'"
strsql = strsql + "'" "," "'"
strsql = strsql + "'" & CmbPp.Text & "'"
strsql = strsql + " from Tdata where payroll_code='" & CmbMrc.Text & "'"
now how to get the values for these columns. are thr any syntax error ?