Lookup Table Editor

D

Dorian Chalom

I am trying to develop a look up table editor.

The underlaying table is:

Table Field Value

The form is a drop down for the Table
a drop down for the Field
and a Textbox for the value.

The problem I am having is that when I change the Table drop down the Field
dropdown and Value Text box does not change. Also when i change the Field
drop down the Value does not change.

Here is the code....

I would appriciate it greatly if some one could help me.

Private Sub cmbTable_AfterUpdate()

If Not IsNull(Me!cmbTable) Then
'Update the list in cmbField to show
'the chosen table fields
Me!cmbField.Requery
Else
'No table chosen, so reset the field combo
Me!cmbField = Null
End If

cmbTable_AfterUpdate_Exit:
Exit Sub

cmbTable_AfterUpdate_Err:
MsgBox Err.Description
Resume cmbTable_AfterUpdate_Exit

End Sub

Private Sub cmbField_AfterUpdate()
' Find the record that matches the control.
Dim strWhere As String

On Error GoTo cmbField_AfterUpdate_Err

'Check if there is criteria chosen and
'proceed only when yes
If Not IsNull(Me!cmbField) Then
'Put together the filter criteria
strWhere = "
= '" & Me!cmbTable & "' AND [Field] = '" &
Me!cmbField & "'"
'First, delete the filter set previously
Me.FilterOn = False

'Set the filter
Me.Filter = strWhere
Me.FilterOn = True
End If

cmbField_AfterUpdate_Exit:
Exit Sub

cmbField_AfterUpdate_Err:
MsgBox Err.Description
Resume cmbField_AfterUpdate_Exit

End Sub
 
D

Dorian Chalom

The problem was the combo boxes were bound. As soon as i removed the
boundedness it worked how I wanted it to.
 

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

Similar Threads


Top