A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Limiting Field Choices based on input in another Field



 
 
Thread Tools Display Modes
  #1  
Old February 10th, 2009, 04:44 AM posted to microsoft.public.access.tablesdbdesign
Chart Builder
external usenet poster
 
Posts: 1
Default Limiting Field Choices based on input in another Field

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?
  #2  
Old February 10th, 2009, 04:55 AM posted to microsoft.public.access.tablesdbdesign
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Limiting Field Choices based on input in another 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

"Chart Builder" Chart wrote in message
...
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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.