|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Stop repeatly entering Same Contact address
Can anyone help, I have an addrees form and everytime someone adds a ne contact i want the main contacts address put into the fields. the main contact has a tick associated with them.
cheers castor Private Sub Command65_Click() Dim MyDb As Database Dim rst As Recordset Dim Company_ID As Integer Dim Main_Contact As Boolean Set MyDb = DBEngine.Workspaces(0).Databases(0) Set rst = MyDb.OpenRecordset("SELECT * FROM Contacts WHERE Me.[Company ID] = [Company ID] AND Me.[Main_Contact] = -1;", DB_OPEN_SNAPSHOT) rst.MoveFirst rst.Edit Me![Address Line 1] = rst![Address Line 1] Me![Address Line 2] = rst![Address Line 2] 'etc rst.Update rst.Close End Sub |
|
#2
|
|||
|
|||
|
remove
rst.Edit rst.update Not needed But by the sounds of it you DB is not normalized. You really should get you DB a close to 3rd normal form as possible. It will make you life easier in the long run. S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Stop repeatly entering Same Contact address |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|