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!

Corupt 1st & 3rd records?

Status
Not open for further replies.

authorsami

Instructor
Sep 11, 2003
155
0
0
US
I have a form that uses a drop down combo box to select which records will be displayed in the lower half of the form. This was working (or so I thought) before I gave it to the user to start entering data. Now there seems to be a problem with it. Let me explain:

When you use the drop down combo box to select the third record, it will only show the data for the first record. If you use it to select any other records it appears to work correctly. i.e.

If I have the following records, Allen, Bob, Charles, David, Edward, Fred.....

I use the combo box to select data for Allen, all goes well.
I use the combo box to select data for Bob, all goes well.
I use the combo box to select data for Charles and I get the data for Allen
I use the combo box to select data for David, Edward or Fred and all goes well.

I have deleted the record for Charles to see if it was the actual record, but it was not. The data for David then will not appear as it is then the third record.

I tried deleted the record for Allen, but this does not fix it. It always seems to be the first and third record....

Please I desparately need some help......

If you like you can contact me off forum if you need to see a copy of the database...

Sharon
authorsami@earthlink.net
 
[tt]
Please don't go off tek-tips with this. I'd like to follow it.

I'll try to get back and study this, but not 'til after mass and the Super Bowl.

Thank you.[/tt]

[glasses][tt]Gus Brunston - Access2000(DAO)
Skill level based on 1-10: 7, on the way to 6, and beyond!
Webmaster: www.rentdex.com[/tt]
 
Ok, I'll be sure to keep the forum posted on my progress or lack there of......Hope it is not the latter.
 
Hi Sharon,

If all else fails, I or someone else can look at your database offline, but this is primarily an open forum, so first of all some questions for you ..

How is your combo populated? If it is multiple column what are the values in all the columns? Can you post the RowSource and RowSourceType Property values.

How is the record information obtained? And how is the form populated from it when it is obtained? Can you post any code involved.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Let's see if I can answer all of the questions.
Here is the code behind the combo box:
--
Private Sub Combo53_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
'rs.FindFirst "[LastName] = '" & Me![Combo53] & "'"
rs.FindFirst "[LastName]& [FirstName] = '" & Me.Combo53 & Me.Combo53.Column(1) & "'"


Me.Bookmark = rs.Bookmark
LastContact.SetFocus

End Sub
--
This is the row source:
--
SELECT qryMe.LastName, qryMe.FirstName
FROM qryMe
ORDER BY qryMe.LastName, qryMe.FirstName;

--
And it is a Table/Query type


I hope this helps.... Let me know if I left something out. I'm new to Access and got WAY over my head on this one...

Thanks again
 
Hi Sharon,

I'm not entirely sure what that FindFirst will do; I would expect it to error out. The criteria should be like an SQL WHERE Clause, so ..

Code:
"[LastName] = '" & Me.Combo53 & "' AND [FirstName] = '" & Me.Combo53.Column(1) & "'"

I would try correcting that first and seeing if it makes a difference.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Having seen the database it seems that for some reason the code was not finding a match for the 3rd person. When no match was found the first record was being returned.

As a further note each patient had a unique SSN number attached to them. This makes a much better string to search on, since it is possible that two people can have the same Fname Lname pair.

Ian
 
Ian
I made the changes to my working copy and still have the same problem.....I don't know what to do....

Did you only make one change to the database or did I miss one?

Sharon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top