Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21088

Selecting Database Columns from ComboBox

$
0
0
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:
Quote:

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 ?

Viewing all articles
Browse latest Browse all 21088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>