Blazer Saga
Registered User.
- Local time
- Today, 10:27
- Joined
- Jan 22, 2007
- Messages
- 12
Hi, I'm trying to creat a form that will delet the related data from a sub form when the check box on the main form that controls the display of the sub form is set to false.
I've had lot of exsperiance with C++ and some with Visual and C #, but this is the first access report I've writen that code more complex then "me.somefiled.visable = true"
The form is for an art sheet database and I anticipate that the salsemen entering the data will change the entries as tehy talk threw things with the customers. Since they will eatch probaly generate 30 or 40 of these entries a day I'm trying to cut down on the overhead of the database.
This is the code for the Delete Query:
DELETE [Numbers Catagory].[Order ID], [Numbers Catagory].*
FROM [Art Sheets] INNER JOIN [Numbers Catagory] ON [Art Sheets].[Order ID] = [Numbers Catagory].[Order ID]
WHERE ((([Numbers Catagory].[Order ID])=[Forms]![Art Sheet]![Order ID]));
And this is the AfterUpdate cod for the check box:
Private Sub Numbers_AfterUpdate()
If Me.Numbers = True Then
Me.Number_Catagory.Visible = True
Else
Me.Number_Catagory.Visible = False
CurrentDb.Execute "Delete Numbers Catagory", dbFailOnError
End If
End Sub
The post below seems like a similar problem, but I am unable to figure out how to aplie it to mine since the way the code is called it diferent, meaning I dont know how to call a DELETE query in that format. Tried, but kept getting sytax errors.
http://www.access-programmers.co.uk/forums/showthread.php?t=96322&highlight=runtime+error+3061
I've had lot of exsperiance with C++ and some with Visual and C #, but this is the first access report I've writen that code more complex then "me.somefiled.visable = true"
The form is for an art sheet database and I anticipate that the salsemen entering the data will change the entries as tehy talk threw things with the customers. Since they will eatch probaly generate 30 or 40 of these entries a day I'm trying to cut down on the overhead of the database.
This is the code for the Delete Query:
DELETE [Numbers Catagory].[Order ID], [Numbers Catagory].*
FROM [Art Sheets] INNER JOIN [Numbers Catagory] ON [Art Sheets].[Order ID] = [Numbers Catagory].[Order ID]
WHERE ((([Numbers Catagory].[Order ID])=[Forms]![Art Sheet]![Order ID]));
And this is the AfterUpdate cod for the check box:
Private Sub Numbers_AfterUpdate()
If Me.Numbers = True Then
Me.Number_Catagory.Visible = True
Else
Me.Number_Catagory.Visible = False
CurrentDb.Execute "Delete Numbers Catagory", dbFailOnError
End If
End Sub
The post below seems like a similar problem, but I am unable to figure out how to aplie it to mine since the way the code is called it diferent, meaning I dont know how to call a DELETE query in that format. Tried, but kept getting sytax errors.
http://www.access-programmers.co.uk/forums/showthread.php?t=96322&highlight=runtime+error+3061