MVF to populate Text box and feed into table - Microsoft Community


i have multivalued field in access 2007 database lists multiple options.  my end goal have main menu form filter using sql filter on value mvf field "contains."  so, created function below identify records contain specified value list supplies mvf, not exact match (in case several options selected).

if not isnull(me![cmbst2p]) then
        sqlfilter = sqlfilter & "([tbldata].[cmbst2p] ""*" & me![cmbst2p] + "*"")" & " , "
    end if

this not search in mvf, want create invisible text box takes in mvf, transfers text box , column of table (to simplify search).  - @ first, tried using sql filter search directly form, since other fields searching directly table, think easier way (and got error in searching form).

i found reliable way link mvf text box typing =[cmbst2p] in control box, however, cannot link table.  so, tried using after update event procedure , using control box link table, got error , unable make work.  my event procedure may have not been designed correctly...   [txtst2p] = [cmbst2p]

any advice appreciated!  is there simpler way of accomplishing this?

don't need go lengths.  multi-valued field reference table?  in situations should case.  in example below cities mvf in contacts table references cities table.  being represented here many-to-many relationship type between contacts , cities means of mvf, rather conventional (and preferable in view) method of modelling relationship type third table, colloquially called 'junction' table, resolves many-to-many relationship type 2 one-to-many relationship types.

mvf has value property.  mvf references table, in each row there set of hidden numeric values, 1 per item in mvf, reference key of referenced table, cities in example, tables can joined on value property, e.g.

select contacts.firstname, contacts.lastname, cities.city
contacts inner join cities
on contacts.cities.value = cities.cityid;

city column non-key text column referenced table, query can restricted on column in usual way return rows contacts where, in example, 1 of cities in mvf birmingham:

select contacts.firstname, contacts.lastname, cities.city
contacts inner join cities
on contacts.cities.value = cities.cityid
cities.city="birmingham";

if, on other hand, mvf unwisely gets values value list, value property text value, query be:

select firstname, lastname, cities.value
contacts
cities.value="birmingham";



Office / Access / Other/unknown / Office 2007



Comments

Popular posts from this blog

Windows 10 does not have any of my previous Windows 7 email address. - Microsoft Community