A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo box to find a record in Access 2007



 
 
Thread Tools Display Modes
  #1  
Old November 22nd, 2009, 03:00 AM posted to microsoft.public.access.forms
LilBomShl
external usenet poster
 
Posts: 21
Default Combo box to find a record in Access 2007

I have a combo box created to find a specific record on a Main form. I've
created many of these in 2003 using my combo box wizard with no problems, but
I can't seem to get one to work in 2007. I used to use an event procedure in
my After Update such as
Private Sub FINDAQUOTE_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[strQuotationNumber] = '" & Me![FINDAQUOTE] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

But it doesn't work in my 2007 form
Has the code changed in 2007 or is there another way to do it??
  #2  
Old November 22nd, 2009, 06:24 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default Combo box to find a record in Access 2007

If it helps, Me.Recordset.Clone is a METHOD of an ADO Recordset and not an
object. The default Library in ac2003 was ADO but it is DAO in ac2007.

Try:
Private Sub FINDAQUOTE_AfterUpdate()
DoCmd.Requery ' Get any changes to the table first.
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[strQuotationNumber] = '" & Me![FINDAQUOTE] &
"'"
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End Sub


LilBomShl wrote:
I have a combo box created to find a specific record on a Main form. I've
created many of these in 2003 using my combo box wizard with no problems, but
I can't seem to get one to work in 2007. I used to use an event procedure in
my After Update such as
Private Sub FINDAQUOTE_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[strQuotationNumber] = '" & Me![FINDAQUOTE] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

But it doesn't work in my 2007 form
Has the code changed in 2007 or is there another way to do it??


--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.