Originally Posted by
Richard12
......
I find AgentSurname, AgentFirmID, and AgentMobile are correctly posted. However the AgentPersonID, a number, appears in AgentKnownAs, and the AgentPersonID field is blank...
Code:
Private Sub cboAgent_Change()
Me.txtAgentSurname.Value = Me.cboAgent.Column(2)
Me.txtAgentFirmID.Value = Me.cboAgent.Column(3)
Me.txtAgentMobile.Value = Me.cboAgent.Column(4)
End Sub
How were you expecting AgentPersonID and AgentKnownAs to be entered into the Table? There's no code in the above for assigning these two Fields, only code to assign AgentSurname, AgentFirmID, and AgentMobile, which you say is working.
The
AgentPersonID, a number, appears in AgentKnownAs, and the AgentPersonID field is blank
sounds as if the AgentKnownAs Field has been set up as a Lookup Field at the Table-level, which is shunned by experienced developers, for the reasons listed here:
The Evils of Lookup Fields in Tables
And as June7 suggested, most developers are going to ask why you're storing all of this redundant information in multiple Tables; normally you'd store the AgentPersonID and other agent data in one, primary Table, then store only AgentPersonID, in the other, ancillary Tables, and merely pull the agent details, as needed, for other Forms, Reports, etc..
In other words, only Fields that are unique to the one, primary Table should be stored in multiple Tables. This is what Relational Databases are all about, and differentiates them from the old-style flat files.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007