Originally Posted by
wjlucas
The SQL is fine. The values are strings and not numbers as some start with '0' and that is needed. Form LOGIN is started from a Navigation form in Access 10. So it runs as a subform. I am in FORM VIEW and running the application when this happens. There is no OnClick VBA code for FIELD1, only AFTER UPDATE code for FIELD1.
Question: If in VBA, I set a attribute field for FIELD3 that MS ACCESS has properties entries for, in this case ROWSOURCE, should that trigger MS ACCESS into thinking the form design has changed? It seems to in my app. If I comment out the line of code Me.Field3.RowSource = SSource, (although it does not work properly, :-)) there is no msg asking me if I want to save design changes to the form. Whether or not I change my selected value for FIELD1, everytime I select something, even if it is the same value I can't go to another subform without it asking me the same question. The specific msg I get when I go to another subform is "Do you want to save design changes to the form Login?"
Again this is the code.
Private Sub Field1_AfterUpdate()
Dim SSource As String
SSource = "SELECT DISTINCT [town name] FROM [nys swis codes] " & _
" WHERE countytowncode = '" & Me.Field1.Column(0) & "'"
Me.Field3.RowSource = SSource
Me.Field3 = Field3.ItemData(0)
DoCmd.Requery "Field3"
End Sub