MS Access, modifying combobox data type -
fairly new ms access (been @ 6 or 7 months , pretty self taught, bow @ alter of google , stackoverflow lot) , working on form database allow user create reports , dictate want in report.
how it's set user has 1 list that's pre-populated , doesn't change select whether report show projects happened during fiscal period, non-project related trips (we'll call them npts now) happened during fiscal period, or project series.
the second list (also prepopulated , unchangeable) activates if first or second item in first list selected. allows user select fiscal period , gives options of either: fiscal year, fiscal quarter, month, or year-on-year comparison.
once item in both of lists selected populates list of 1 or 2 comboboxes options based on what's available in table it's pulling from.
the first combobox populated , visible, it's populated alters. if fiscal year, fiscal quarter, month or year-on-year options selected first combobox populated available fiscal years, , if project series option selected it's populated list of series names.
there second combobox isn't relevant question i'll leave details out.
my problem comes first combobox. when open new instance of form no data type assigned combobox let's user wants create report projects in fiscal year , he/she selects fiscal year in combobox changes mind , decides report project series. when go try , select project series name in combobox populated fiscal years earlier error message pops stating you're trying input text numeric data type field.
so question is, there way programmatically change allowed data type first combobox in afterupdate sub of first list?
here's example of have first list afterupdate sub (rptbytype first list):
me.combobox1.rowsource = switch(rptbytype = project, _ "select distinct proj.fiscyr proj order proj.fiscyr desc;", _ rptbytype = trips, "select distinct npt.fiscyr npt order npt.fiscyr desc;", _ rptbytype = projseries, "select distinct proj.seriesnm proj;") and again fiscyr in integer format, while seriesnm in string format, combobox1 not bound field
Comments
Post a Comment