Auto Fill In Combo Box From Combo Box


M

Maurita

Hi, I need help automatically filling in a combo box (Combo2) from the
choice I make from another combo box (Combo1). The choice in Combo2 is
not related to Combo1, but is dependent upon the choice from Combo 1.
When the user chooses "Production" from Combo1, I need the cursor to be
placed in Combo2 and to either choose the "Productive" choice from
Combo2 or to have "Productve" automatically filled in Combo2. The
following code shows the cursor going to Combo2, but I can't figure a
way to fill in Combo2 with "Productive" when "Production" is chosen
from Combo1. Since there are multiple choices for "Downtime", I just
need to get the cursor to the combo box and let the user choose from
the list, which the following code does. I am only having trouble if
the user chooses "Production" from Combo1 because "Productive needs to
be automatically filled in Combo2. I appreciate any ideas. Thank you.

Maurita Searcy

If Me!Combo1 = "Production" Then
DoCmd.GoToControl "Combo2
ElseIf Me!Combo1 = "Downtime" Then
DoCmd.GoToControl "Combo2
End If
 
Ad

Advertisements

G

Guest

you were on the right track.

If Me!Combo1 = "Production" Then
Me.combo2.value="Productive" automatically enter value
ElseIf Me!Combo1 = "Downtime" Then
DoCmd.GoToControl "Combo2 'goto control so user can make selectiong
End If

Daniel
 
M

Maurita

Daniel,

Thank you so very much for your help, unfortunately, I keep getting a
Run-Time error '3163' stating the field is too small to accept the
amount of data I attept to add and to try to insert or paste less data.


Do you have any idea what I need to do to correct this problem?

Thank you.

Maurita
 
G

Guest

Hi Maurita,

You will get that error if you are trying to save too much text into say a 3
character field, or text into a numeric or date field or whatever.

Check that the field your combo is bound to is sized/typed correctly for the
data you want to store.

Damian.
 
Ad

Advertisements


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