Refer to Table!Field from Code - How ???

  • Thread starter Thread starter Brian Kenneally at Proskid Pty Ltd
  • Start date Start date
B

Brian Kenneally at Proskid Pty Ltd

Environment: Access 2000 .mdb



I have a main form with a couple of subForms. The main forms’ data source is
a table.



tblMyTable



There is a combo box on the main form where the user selects a name from the
Customer table



tblCustomers



What I am trying to do is this……



Using the AfterUpdate event on the combo box I want to check a field on
tblCustomers.



The field I want to check is a Yes/No field and, based on the value found, a
further event may be triggered.



I am having real trouble with this.



The application is in use already so it is too late to make fundamental
changes to its structure.



Any help would be greatly appreciated.



Thanks.
 
You could use DLookup, but it's much easier to add the field to the combo
box's row source, and use that. So:

Select IDField, MyField, MyYesNo From tblCustomers

Sub cboMycombo_AfterUpdate()
If Me.cboMyCombo.Column(2) = True Then ' Zero based
' Do this
Else
' Do that
End If
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top