UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Table Updating And It Should Not, Access 2010    
 
   
dlafko
post Aug 19 2017, 05:00 PM
Post#1



Posts: 158
Joined: 7-May 14



I have been pounding my head for days so hopefully you all can help.

I have a relational database with 3 tables. Employee, Error_Log ( Data holding ) and TypeofError. The Employee Table and TypeofError table are just suppose to store info. Employee holds the names of the employees. TypeofError should just be holding the type of errors. The employee table is working fine. I load in an error_log in the form and the entire thing goes under the employee name.

The issue. When I add the error from a Combo Box it is creating it again in the TypeofError log so instead of having 2 error types I am getting more and more everytime I enter a log.

Any ideas?

Database is attached. I am just starting it so can be changed.
Attached File(s)
Attached File  Error_Log1.zip ( 71.34K )Number of downloads: 1
 
Go to the top of the page
 
tina t
post Aug 20 2017, 09:56 AM
Post#2



Posts: 5,196
Joined: 11-November 10
From: SoCal, USA


not everybody can look at .accdb databases, and of those that can, not everybody wants to download databases onto their PCs. what is the RecordSource of your form? if it's a table, what is the table name? if it's a query, pls post the SQL statement of the query. also, what is the RowSource of your combobox control? and what is the ControlSource of the combobox control?

hth
tina

--------------------
"you can't take the sky from me"
Go to the top of the page
 
RJD
post Aug 20 2017, 12:38 PM
Post#3


UtterAccess VIP
Posts: 7,816
Joined: 25-October 10
From: Gulf South USA


Hi: The root of your problem is that you are pointing the error combobox to the TypeOfError table field instead of to the Error_Log table field. It should be pointed to the IDError in Error_Log, with a change in the source to add the IDError to the available fields. This will write the IDError to the Error_Log table instead of duplicating the records in TypeOfError.

Take a look at my revision to your db. See the combobox and how it is populated, and how this now links to the proper table, and especially how the fields are accounted for in Column Count and Column Widths.

I would also suggest that you consider removing the spaces from your object names, and use a standard object naming prefix such as tblError_Log. This helps to clarify your coding and use, and can minimize errors.

HTH
Joe
Attached File(s)
Attached File  Error_Log1_Rev1.zip ( 32.48K )Number of downloads: 3
 

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
RJD
post Aug 20 2017, 01:34 PM
Post#4


UtterAccess VIP
Posts: 7,816
Joined: 25-October 10
From: Gulf South USA


tina: Here are the original file and my Rev1 correction, both in 2002-2003 mdb format, in case you are interested in seeing this...

Regards,
Joe
Attached File(s)
Attached File  ErrorLog1.zip ( 68.73K )Number of downloads: 4
 

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
dlafko
post Aug 21 2017, 05:42 PM
Post#5



Posts: 158
Joined: 7-May 14



RJD,
Thanks so much. I banged my head for so long. So now that this is working, should I delete the row out of the ERROR_Log since it does not appear to being saved their any way? Also when I generate a report I would use the Type of Error Table and The Error field instead of pulling it all from the Log Right?

I will also update the names as you suggested.
Go to the top of the page
 
RJD
post Aug 21 2017, 10:44 PM
Post#6


UtterAccess VIP
Posts: 7,816
Joined: 25-October 10
From: Gulf South USA


Hi: Since you have the IDError in the Error_Log records, it is not necessary to have the field TypeOfError field as well. You can delete that. When you need the description, you can always get it by linking to the TypeOfError table through the IDError. You can link this with a JOIN in a query, and use that query as the record source for a report.

Getting the TypeOfError description this way allows you to adjust/expand the description (or even add other fields in that table) if necessary by adjusting the records there rather than in all the places the error is indicated in the Error_Log table. This is a basic relational db approach.

Good luck with your project.

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    13th December 2017 - 12:29 AM