Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Update Query duplicates data in table as well as updating</b>

Status
Not open for further replies.

IainGreen

Technical User
Jan 21, 2004
7
GB
I have a problem using an update query with a subform.

The subform 'IssuedTo' contains combo boxes with selection options (employee initials), representing members of staff assigned to a particular job number.

There can be any number of employees assigned to one job number.

All the 'IssuedTo' information is stored in a table called 'TabWays'.

The problem is that each time I run the update query after an 'Upon Close'event on the whoile form, the 'Issued To' data is duplicated as well as updated.

For example, if a job number has 'AJ' assigned to it before I go into the form and I add 'TM' to the job too, the 'TabWays' will be updated to AJ/AJ/TM - i.e. AJ is duplicated.


Any ideas - is it an IF statement on the code behind the 'Upon Close' event on the form or am I using the update query in totally the wrong way?

Here is the update query:

Field: IssueTo
Table: TabWay
Update To: [TabWay]![IssueTo] & [TabHWIssued]![IssuedTo] & "/"

The "/" is used to separate the different employee initials.

I was running just this query on close event for the whole form on which the subform containing the IssuedTo field is situated. I was not using an IF statement, I just wondered if that might be the answer.

How can I stop it duplicating upon closure of the form BUt still add the new data?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top