Re: How Do I Get My Changed Table Relationships To Be Updated in the linked Front end?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Dec 10, 10:19 am, John W. Vinson
<jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Wed, 10 Dec 2008 08:09:01 -0800 (PST), nouveauricheinvestme...@xxxxxxxxx
wrote:

Hi,

I have a table where I changed the relationship in the back end to
Delete Cascade Records and it is not reflected in the front end. How
do I get this change in the relationship to be reflected in my front
end? I have tried importing the tables that need the relationship
modifications to the front end and modifying the relationships there
and then recreating the linked tables and it is still not reflected in
the front end. How do I change this relationship in my front end?

The relationships DO NOT EXIST in your front end, only in the backend, where
the tables are. What you see in the relationships window is just advisory, and
is not (and cannot be) enforced.

You'll need to delete the tables that you imported - you now have two copies
of each such table, one in the frontend, one in the backend!!! Back up your
database (or make sure that you still have the backup you hopefully made
before you started importing tables and use it). After you do so, compact the
database; delete all your table links in the frontend; compact to get rid of
Access' memory of them; and use File... Get External Data... Link to relink to
the tables in the backend. The relationships window in the frontend should now
reflect the actual relationships defined in the backend, but if it doesn't,
don't worry about it; the cascades etc. will still be obeyed.
--

John W. Vinson [MVP]

Yes I did delete the tables in my front end. I also deleted all of
the linked tables and then I did compact and repair. I understand the
relationships I see in the front end are inconsequential, but I can't
see what else my problem would be. To give you a thorough
understanding of what is going on, I have detailed below.

I have a form that is bound to my parent table [Pending Tickets] and I
have a subform which is bound to my child table [Order_Details]. When
a user hits cancel, the following code is run:

Public Sub DelUnneededRecords(MyID As Integer)

Dim DelMyOrders As String
Dim DelMyTicket As String
Dim DelNullRec As String

DelMyOrders = "DELETE Order_Details.* FROM Order_Details WHERE
Order_Details.PTID=" & MyID & ";"
DelNullRec = "DELETE Order_Details.* FROM Order_Details WHERE
Order_Details.PTID Is Null;"
DelMyTicket = "DELETE [Pending Tickets].* FROM [Pending Tickets] WHERE
[Pending Tickets].ID=" & MyID & ";"



If TicketNumbers = True Then
DoCmd.RunSQL DelMyOrders
End If
DoCmd.RunSQL DelMyTicket
DoCmd.RunSQL DelNullRec
DoCmd.SetWarnings True


End Sub

If the user enters data in the parent form without entering anything
in the subform, they will get an error message stating:

You cannot add or change a record because a related record is required
in table 'Pending Tickets'.

If the user enters data in both the parent form and the child form, no
error message.

Two other odd facts about this:

1. When I enter a record manually in the [Pending Tickets] table and
a related record in the child table Order_Details, making sure to
relate the record with the foreign key, I then can run the above
procedure from the immediate window and I don't get an error
message.

2. When I comment out the Docmd.DelMyTicket, I do not get the error
message either, but it does not delete the record - i.e. the sql
statement seems to be deleting the record from my parent table,
despite the error message.
.



Relevant Pages

  • Re: If Hidden BackEnd BE not found then supress error revealing its location?
    ... ERROR MESSAGE I'm receiving: ... code runs in the Form_Open and I recieve the error message. ... david epsom dot com dot au wrote: ... I have hidden the BackEnd. ...
    (comp.databases.ms-access)
  • Re: Error 3075
    ... Wayne Morgan ... MS Access MVP ... > I have a normal application split into a frontend and backend. ... I get the error message 3075 "Syntax error ...
    (comp.databases.ms-access)
  • Re: Problem with Runtime Error 2448
    ... getting an error message 2450 can not find form referred to. ... To refer to a parent form, ... its using the string strwhere. ... Private Sub Search_Click ...
    (microsoft.public.access.modulesdaovba)
  • file in use, could not use
    ... I have two databases that are both linked to the same backend table. ... ..but the error message appears when I run any queries linked to the table. ... I haven't a clue. ...
    (comp.databases.ms-access)
  • Re: Continuous form First record
    ... that puts a 0 in the second record and I get an error message that it created ... a duplicate. ... I would use a SQL statement to insert the record when the parent form ... But are you sure that a Textbox/listbox combination wouldn't be a ...
    (microsoft.public.access.formscoding)