Louly wrote:
luanhoxung wrote:
find the answer here:
http://www.mvps.org/access/forms/frm0028.htm
Thanks for your quick reply.
I've tried it but it didn't work also. I think the problem is that the
system doesn't understand that what's selected in the "cmb A" is a
table and what we need for "cmb B" is the list of fields in this table.
I still need help with this.
Perhaps ADO can help here.
This more or less air code works for me:
Private Sub Combo0_AfterUpdate()
With Combo1
.Value = ""
.RowSource = Combo0.Value
End With
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim f As ADODB.Field
Dim r As ADODB.Recordset
Set r = CurrentProject.Connection.OpenSchema(adSchemaTable s)
Set f = r.Fields("TABLE_NAME")
Combo1.RowSourceType = "Field List"
With Combo0
.RowSourceType = "Value List"
While Not r.EOF
.RowSource = .RowSource & f.Value & ","
r.MoveNext
Wend
End With
End Sub
Combo0 is tables, Combo1 is fields. Their rowsource in the property
sheet is left blank for both.
Requieres Access>= 2000.