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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

continuous form detail section updates all records

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
0
0
US
I have a bound form with the following fields
tblUserErrors
Errorid
ErrorDate
ErrorBy
ErrorType (combobox)
ErrorComments
ErrorPDFLink

browse button
open button

The form displays the records correctly but when they update one record, it updates all of the records for the same thing.
Adding a new error is on a different form and they have to add 1 error at a time. This is the review/edit screen.
what do I need to check to make sure that if they update one field say ErrorType, that it only updates that record and not all of the records on the form?
Thanks
Lhuffst
 
My guess is that your combo box is unbounded. What is the controlsource and row source?
 
Recordsource on the form

SELECT tblErrors.ErrorId, tblErrors.ErrorDate, tblErrors.ErrorById, tblErrors.ErrorBy, tblErrors.ErrorType, tblErrors.ErrorComments, tblErrors.ErrorPDFLink
FROM tblErrors;

field info in detail section
name control source
Errorid errorid
errordate errordate
errorby errorby
txtuserid txtuserid.Value = ErrorBy.Column(1) This is unbound and I negelected to put it in the first post
errortype errortype
errorcomments errorcomments
tdlink errorpdlink

do you think the txtuserid box is throwing it off?
 
Yes, but not sure what you are doing there. What is the relation between a User and and Error? I would think an error has a 1 related user. If so could you make the recordsource a query including the userid?
 
Lhuffst,
You have been using TT long enough to understand how to use TGML to make your posts

[pre]
Name Control Source
Errorid errorid
errordate errordate
errorby errorby
txtuserid [highlight #FCE94F]txtuserid.Value = ErrorBy.Column(1)[/highlight] This is unbound and I negelected
to put it in the first post
errortype errortype
errorcomments errorcomments
tdlink t]errorpdlink[/pre]

You aren't consistant with the Control Source regarding the txtuserid and haven't identify which columns/controls display incorrectly. Are they all affected or just one? Also, is there any code or a macro?

Duane
Hook'D on Access
MS Access MVP
 
Duane,
There are several inspectors and this form is for when they do not fill in paperwork correctly so I don't think I can pass the id to the query.
However, the txtuserid box was a box that I used to verify the id of the inspector.
All of the fields (except errorid), upon opening, display properly but when I edit any field such as errorby or errortype, will change all of the records to have that error.
What I have right now is:
id errordate errorby txtuserid errortype ......
1 8/10/2015 wdorey 15 Permit Address Incomplete
2 9/17/2015 dkuriny 17 Deposit Form Incomplete
3 10/4/2016 lhuffst 3 001
.
.
.

I updated the Errorby on id 1 and now the form shows
id errordate errorby txtuserid errortype ......
1 8/10/2015 dkuriny 17 Permit Address Incomplete
2 9/17/2015 dkuriny 17 Deposit Form Incomplete
3 10/4/2016 lhuffst 17 001

I'm going to remove the txtuserid and see if that helps
lhuffst
 
Please try to use the TGML Pre tag to make your data readable. It's the least you could do if you expect others to assist with your issues.

You still didn't provide the actual control source of the txtUserID. Why do you mention "Value"?

Duane
Hook'D on Access
MS Access MVP
 
Unless that is a bad example, the only thing that changes is the unbound control. It will likely do that because that is an unbound control. I just would not do it that way. I still do not guess what you are trying to do here
txtuserid.Value = ErrorBy.Column(1)
If txtuserID is unbound, I would expect all to show the same value in column 1 of the combobox
 
Dhookom - Errorby is 2 columns and I was just trying to get the value of column 1 so I could verify that I had the right information returning.
MajP - you are correct, it did copy the name all the way down. I removed the unbound box and it now looks as expected.

thanks to both of you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top