By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

Help RecordsetClone problem

imrosie
100+
P: 222
Hello,

I have a search form that uses a row query to locate a customer by customerID and first & last names, so it's an unbound control. I also have two events associated with this control, 'NotInList' (for customer not in table) and AfterUpdate event which (uses RecordsetClone by customeriD.

The Recordsetclone event allows for the other data stored associated with the customer that's located. However, a strange thing occurs when a new customer is added to the 'List', I end up with 2 entries in the customer table associated with a new customer.
Entries:
1.) a line in the Customer table with the name only (new customerID--assigned by autonumber
2.) a second line in Customer table with no name, but all the other information filled in, and another customerID

Is there a better way to bring up customer data without using Recordsetclone? Here's the 'AfterUpdate' procedure:

Expand|Select|Wrap|Line Numbers
  1. Private Sub custname_AfterUpdate()
  2. Dim rst As Object
  3.  
  4. Set rst = Me.RecordsetClone
  5.  
  6. rst.FindFirst "Customers.[CustomerID]=" & Me![custname]
  7. If Not rst.NoMatch Then
  8.  
  9.   Me.Bookmark = rst.Bookmark
  10. Else
  11.   'Not found!
  12. End If
  13.  
Thanks in advance,
Rosie
Jul 26 '07 #1
Share this Question
Share on Google+
2 Replies


missinglinq
Expert 2.5K+
P: 3,532
Rosie, you've once again posted a question on the Access Articles section! I'll move it over to the Access Forum for you, but please be more careful in the future. Aside from the fact that you're making extra work for the moderators, posting a question to the Articles section means that it's not being seen by most of the members and hence decreasing the chance that you'll get a timely response.

Linq ;0)>
Jul 26 '07 #2

imrosie
100+
P: 222
Rosie, you've once again posted a question on the Access Articles section! I'll move it over to the Access Forum for you, but please be more careful in the future. Aside from the fact that you're making extra work for the moderators, posting a question to the Articles section means that it's not being seen by most of the members and hence decreasing the chance that you'll get a timely response.

Linq ;0)>
Sorry Missinglinq,,,
I'm going to "Start a Discussion"under Forum (I thought) and obviously I"m in the wrong place when the discussion begins. thanks for moving it over...I'll
look more carefully in the future.

Rosie
Jul 26 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.