Combo Box IF Statement

J

JR012

In my database i have a coombo box that contains 4 entries. This box is
called type. I also have a text box below called scent9 and i want a certain
name to be put in this text box when one of the 4 entries in the combo box is
selected. I need this to happen when the combo box slection changes.
I have used the folowing code
if type = "SAVE" then
scent9 = "SAVE"
else
scent9 = "Apple"
end if

I know this will be something very easy to solve, so I hope someone will be
able to assist me with this problem.

Thanks
 
F

fredg

In my database i have a coombo box that contains 4 entries. This box is
called type. I also have a text box below called scent9 and i want a certain
name to be put in this text box when one of the 4 entries in the combo box is
selected. I need this to happen when the combo box slection changes.
I have used the folowing code
if type = "SAVE" then
scent9 = "SAVE"
else
scent9 = "Apple"
end if

I know this will be something very easy to solve, so I hope someone will be
able to assist me with this problem.

Thanks

If the value to be saved is the same as the value selected:
You can set the value of a text control to the selected value of a
combo box using the Combo Box AfterUpdate event:

Me![Scent9] = Me!Type

But why not just make the combo box bound to the [Scent9] field?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top