syncronising records

lxh

Registered User.
Local time
Today, 17:00
Joined
Feb 26, 2004
Messages
43
Hi There

I have two tables (also forms) project (the primary table) and bank
I'm trying to synchronise the two forms by setting the ProjectID field that they both have in common. It is a one-to-one relationship. If the projectID doesn't exist in bank then it should be created. If it does the form should jump there. I can get it to go there if it exists but not create it if it doesn't - the code I use is below. Can any one see the problem? thanks for your time
Lex :o

Private Sub side_bank_Click()
Dim frmCallingForm As Form
Dim FormFocus As String

Set frmCallingForm = Screen.ActiveForm
FormFocus = "BankDetails" 'change this to make the code below generic

If frmCallingForm.Name = FormFocus Then
End
End If

DoCmd.OpenForm FormFocus, acNormal, , "ProjectDetailsID=" & frmCallingForm.ProjectDetailsID, acFormEdit, acWindowNormal

DoCmd.Close acForm, frmCallingForm.Name, acSaveYes

End Sub
 

Users who are viewing this thread

Back
Top Bottom