Sam Summers
Registered User.
- Local time
- Today, 13:04
- Joined
- Sep 17, 2001
- Messages
- 939
Hi
I have just found a major loop hole in my application which is:-
My database has five types of equipment and various items of each or any type may be set as being at a certain location.
I have a move all button that moves all the items from their current location to a newly selected one.
What i have just discovered is that when the user selects the new location and clicks on the button which runs this query:
INSERT INTO AccessOnHire ( HireDate, EquipmentID, LocationID )
SELECT Equipment.HireDate, Equipment.EquipmentID, Equipment.LocationID
FROM Equipment
WHERE (((Equipment.EquipmentID)=[Forms]![ViewbyLocation]![EquipmentID]) AND ((Equipment.LocationID)=[Forms]![ViewbyLocation]![LocationID]));
All the items of all the categories are moved instead of just the ones currently displayed in the continuous form 'ViewbyLocation'.
This is critical to the functionality of the database.
This query is also run at the same time but only updates the appropriate record that the record selector is currently pointing to as opposed to all the items in the database:
UPDATE Equipment SET Equipment.HireDate = [Forms]![Main]![RefDate]
WHERE (((Equipment.EquipmentID)=[Forms]![ViewbyLocation]![EquipmentID]) AND ((Equipment.LocationID)=[Forms]![ViewbyLocation]![LocationID]));
Thank you in advance
I have just found a major loop hole in my application which is:-
My database has five types of equipment and various items of each or any type may be set as being at a certain location.
I have a move all button that moves all the items from their current location to a newly selected one.
What i have just discovered is that when the user selects the new location and clicks on the button which runs this query:
INSERT INTO AccessOnHire ( HireDate, EquipmentID, LocationID )
SELECT Equipment.HireDate, Equipment.EquipmentID, Equipment.LocationID
FROM Equipment
WHERE (((Equipment.EquipmentID)=[Forms]![ViewbyLocation]![EquipmentID]) AND ((Equipment.LocationID)=[Forms]![ViewbyLocation]![LocationID]));
All the items of all the categories are moved instead of just the ones currently displayed in the continuous form 'ViewbyLocation'.
This is critical to the functionality of the database.
This query is also run at the same time but only updates the appropriate record that the record selector is currently pointing to as opposed to all the items in the database:
UPDATE Equipment SET Equipment.HireDate = [Forms]![Main]![RefDate]
WHERE (((Equipment.EquipmentID)=[Forms]![ViewbyLocation]![EquipmentID]) AND ((Equipment.LocationID)=[Forms]![ViewbyLocation]![LocationID]));
Thank you in advance