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

Findfirst not finding a newly added record in Recordselect.clone

Status
Not open for further replies.

davejackson

Technical User
May 8, 2001
34
GB
Hello,

I have two combo boxes, neither of which are bound to a table (so I can move values into them by using the next record buttons). The first one shows all three fields of a table (Bank, City, BankID), the second one only shows the second field (City). Therefore a user can either select the record using a mouse from the first combo box, or type in values into the two boxes. If he/she does this and the combination of the fields from the boxes to not match a record, they are prompted to add a new record in another form which contains a list of all the banks in which cities. This form will automatically assign an autonumber key field to the bank/city combination to give the BankID. After the record has been added, after a requery of the combo box field, the new record is visible by pulling down the first combo box (with the newly assigned BankID) but if l try and move to the new record by using the following code in the AfterUpdate event,

Set rs = Me.Recordset.Clone
rs.findfirst "[BankID] = " & Str(Me![BankID2])
Me.Bookmark = rs.Bookmark

the findfirst cannot find the new record with the newly assigned BankID. I therefore suspect that it is something to do with my Recordset.Clone being taken at an earlier point and so is not up to date enough to find the latest record.

Any help would be brilliant, Thanks in advance,

Dave

 
Dave,

What you are seeing is a result of the following. The recordset is a copy of the records not the actual records themselves. So when you add a new record the copy of the recordset is not updated and when you go to find it it does not exist in the recordset even though the record is added.

What you will need to do is refresh the recordset, and then do the findfirst action.


Hope this helps.

Steve :)
 
Thanks for the help, it would be great if you could tell me how to do this.

Sorry for being stupid but my Access Help is playing up and doesn't want to be very helpful.

Thanks again,

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top