Limiting Field Choices based on input in another Field

  • Thread starter Thread starter Chart Builder
  • Start date Start date
C

Chart Builder

I have two fields in a table called Chart and Account Group. How do I limit
the selections available in the Account Group field based on what a user keys
into the Chart field?
 
Hi Chart Builder,
you could use a combo for the chart field.
Build the row source as a sql string with a where clause based on what the
user enters for Account group.

Something like this

Dim strSQL as String

If Not IsNull(Me.AccountGroup) Then
strSQL = "SELECT yadda, yadda " _
& "FROM TableName " _
& "WHERE AccountGroup = """ & Me.AccountGroup & """"

Debug.Pring strSQL
Me.Chart.RowSource = strSQL

End If


Note: the above assumes that AccountGroup is a text field.
Replace the table, control and field names with the appropriate names.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top