Limiting Field Choices based on input in another Field

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?
 
J

Jeanette Cunningham

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
 

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