If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: update many text fields based on a combo box if statment required??

Hi,
my name is andrew I am doing this as a favour to my boss, and have limited access exp, can some please help me!??
I have a combo box (productname) the rowsource is based upon another combo box (categoryname), works no problem, with a query. 'after update' on the productname I have this

this also works the 2nd combo box (productname) selection send the info to 2 fields on the form. want i need to do update many fields based on consecutive choice, to specify that :

if the fooditem1 field and the calories1 already have a selection from the combo box (productname). then the next (productname combo box) choice will update the next two field on my form fooditem2 and calories2.
i have 10 food fields and calorie fields in my form, and i dont want 2 combo boxes corresponding to each of the 10 fields, but want the combo box productname to cascade down and update all fields that are null

any ideas!? i have a feeling an iif null then update next field type of statmenet but dont have much idea what im doing

update many text fields based on a combo box

Hi Sinndho
thankyou so much for your reply, I choose your 2nd option as both columns 1 and 2 from the combo box need to update together, text field 1 and 1 and
then if not null text field 2 and 2 etc. looks like this:

I have put as the source the query that my form is based upon... but I am getting a runtime error 3061 too few parameters. expected 6, it is highlighting:

currentDb.execute strSQL, DbSeeChanges

just to reiterate I want a combo box with 2 columns to update 2 text fields on my form, if those text fields are not null the selection moves to the next 2 text fields, thereby I create a list of choices on my form derived from the combo box. fields are fooditem1, fooditem2, etc and calories1, calories2 etc
combo box is called 'productname' and has two columns. Form is called 'day'
and based on 'calender query'