Hello,
I am new to this. I wrote this vba code that once you hit a command button it it queries the selected fields ( geography, year, qtr, industry, sex and age) and puts their distinct values into their corresponding list boxes.
but in the industry field i keep getting this error message
run-time error '2176' 'the setting for this proporty is too long'
a snapshot of the code:
Private function getquery(field as string, table as
string)
dim rtabel as string
set rtable=currentdb.openrecordset("select
distinct "& field & " from [" & table & "] order
by " & field & " asc;"
private sub cmdselecttabletoquery_click()
dim tbl1 as string
if checkgeog(tbl1)="sic3" then
forms!ledform!lstindustry.rowsource=getquery
("sic3",tbl1)
end if
Thanks in advance for any help
I am new to this. I wrote this vba code that once you hit a command button it it queries the selected fields ( geography, year, qtr, industry, sex and age) and puts their distinct values into their corresponding list boxes.
but in the industry field i keep getting this error message
run-time error '2176' 'the setting for this proporty is too long'
a snapshot of the code:
Private function getquery(field as string, table as
string)
dim rtabel as string
set rtable=currentdb.openrecordset("select
distinct "& field & " from [" & table & "] order
by " & field & " asc;"
private sub cmdselecttabletoquery_click()
dim tbl1 as string
if checkgeog(tbl1)="sic3" then
forms!ledform!lstindustry.rowsource=getquery
("sic3",tbl1)
end if
Thanks in advance for any help