robert_neville
New member
- Local time
- Today, 05:29
- Joined
- Apr 29, 2003
- Messages
- 9
My database serves as a complex contact manager, which no other commercial product emulates. My database has a Company Form for inputting company information. The Company form has an address subform.
My objective involves selecting a previously entered address through a combo box field (addr1) and having AfterUpdate code automatically fill in the other address fields. My code draft returns an error upon activating the event. The combo box should allow new records for the input and to easily change the company addresses as well. The error message and code follow below.
Run-time error ‘3331’:
Error Description: To make changes to this field, first save the record
Private Sub cboAddr1_AfterUpdate()
' DOES NOT WORK
Me![txtCompAddrID] = Me![cboAddr1].Column(0)
Me![cboAddrName] = Me![cboAddr1].Column(1)
Me![cboAddr1] = Me![cboAddr1].Column(2)
Me![cboCity] = Me![cboAddr1].Column(3)
Me![cboStateID] = Me![cboAddr1].Column(4)
Me![txtPostalCode] = Me![cboAddr1].Column(5)
Me![txtCountry] = Me![cboAddr1].Column(6)
End Sub
Let me know if you could lead me in the right direction with this objective.
My objective involves selecting a previously entered address through a combo box field (addr1) and having AfterUpdate code automatically fill in the other address fields. My code draft returns an error upon activating the event. The combo box should allow new records for the input and to easily change the company addresses as well. The error message and code follow below.
Run-time error ‘3331’:
Error Description: To make changes to this field, first save the record
Private Sub cboAddr1_AfterUpdate()
' DOES NOT WORK
Me![txtCompAddrID] = Me![cboAddr1].Column(0)
Me![cboAddrName] = Me![cboAddr1].Column(1)
Me![cboAddr1] = Me![cboAddr1].Column(2)
Me![cboCity] = Me![cboAddr1].Column(3)
Me![cboStateID] = Me![cboAddr1].Column(4)
Me![txtPostalCode] = Me![cboAddr1].Column(5)
Me![txtCountry] = Me![cboAddr1].Column(6)
End Sub
Let me know if you could lead me in the right direction with this objective.