2
votes

I have a table named "monades" with three fields

1.monada
2.nomos
3.perioxi

My entry in the 1st field (monada) has a unique entry in the 2nd field(nomos) and in the 3rd (perioxi).

I create a form with a combo box for the field "monada" and two text boxes,one for each other field.

I would like to update the 2 text boxes each time i change the value of my combo box.

For example,if i choose "1o MAL" in the combo box,i would like to get "crete" in nomos txt box and "chania" in perioxi txt box.

In order to get this,i have added in the BeforeUpdate method of each txt box the line

=[monades]![nomos} and = [monades]![perioxi].

My form is connected with the table "monades"

How could i fix it and get my job done??I have wasted many hours to get it work..:(

UPDATE:

Something like this doesn't works too

Private Sub monada_AfterUpdate()
If Not IsNull(Me!monada) Then
     Me!nomos.Value = Me!monada.Column(1)
     Me!perioxi.Value = Me!monada.Column(2)
     Me.Requery
End If
End Sub
1
@androidDE Shouldn't it be Column(0) and Column(1)? Usually assuming the first column (i.e. Column(0)) has the visible dropdown values, and the second column (i.e. Column(1)) has the desired values... :)bonCodigo

1 Answers

0
votes

My fault is that i had to set "Column Count=3". If i fix that,and i paste the Update code from above everything works fine!! Thanks for your time mates!!:)