From: Avid Fan on 26 Mar 2010 14:44 I have set a relationship between the master and child tables. Customer.ID -> callnotes.Customer_ID Enforce referential integrity. Cascade updates. I am told Access is supposed to put the customer.ID value in the callnotes.Customer_ID it is not working How do I do it manually in VBA code?
From: Dirk Goldgar on 26 Mar 2010 15:12 "Avid Fan" <me(a)privacy.net> wrote in message news:%236Q8lRRzKHA.3884(a)TK2MSFTNGP06.phx.gbl... >I have set a relationship between the master and child tables. > > Customer.ID -> callnotes.Customer_ID > > Enforce referential integrity. > Cascade updates. > > > I am told Access is supposed to put the customer.ID value in the > callnotes.Customer_ID it is not working > > > How do I do it manually in VBA code? You don't. This is controlled by the Link Master Fields and Link Child Fields properties of the subform control. If you created that relationship after you added the subform to the main form, Access would not have been able to guess that those were the linking fields, so you have to go to the properties of the subform control -- the control on the main form that displays the subform -- and enter "ID" in the Link Master Fields property and "Customer_ID" in the Link Child Fields property (without quotes around the field names). -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: John W. Vinson on 26 Mar 2010 15:18 On Sat, 27 Mar 2010 05:44:44 +1100, Avid Fan <me(a)privacy.net> wrote: >I have set a relationship between the master and child tables. > >Customer.ID -> callnotes.Customer_ID > >Enforce referential integrity. >Cascade updates. > > >I am told Access is supposed to put the customer.ID value in the >callnotes.Customer_ID it is not working WHat happens when you enter data into the note field? I have NEVER ONCE seen a master/child link field fail. I think your expectation is what is faulty: just having the relationship or having the master/child links will NOT automagically create a new empty record in the callnotes table. It will only be created when you *actually enter data onto the subform* - are you? -- John W. Vinson [MVP]
From: John W. Vinson on 26 Mar 2010 21:31 On Sat, 27 Mar 2010 11:48:32 +1100, Avid Fan <me(a)privacy.net> wrote: >I fill data into the memo text box. I change the one other control left > combobox > >I even have a save record and move to next record buttons on the forms > >I have placed a text box control linked to customer_id the only way I >can get the record to save is by placing a valid ID number in the field. And this is in fact a Subform in a subform control (not a popup form launched from code)? Please post the SQL view of the mainform and the subform's Recorsource properties and (again) the Master Link Field and Child Link Field properties of the Subform. Something is very very odd here. -- John W. Vinson [MVP]
From: John W. Vinson on 26 Mar 2010 22:43 On Sat, 27 Mar 2010 13:06:42 +1100, Avid Fan <me(a)privacy.net> wrote: >The error was in the Master Link Child link property of the subform. >for some reason they were linked to customer.Id callnotes.ID instead >of callnotes.customer_ID > >It was an "ID ten IT " error (ID10T) I *won't* post how many times I've been burned by the same kind of error... <g> Glad you figured it out! -- John W. Vinson [MVP]
|
Pages: 1 Prev: access to outlook 2003 Next: PLEASE HELP: Display results in footer section of a split form |