Can not pull up record with combo box

G

Guest

I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
G

Guest

Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub
 
G

Guest

Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks



Klatuu said:
Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub


George said:
I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
G

Guest

Is the name of your control Combo2?
I don't see the problem. This is the most common way to find a value in a
field and make the record found the current record in the form.

George said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks



Klatuu said:
Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub


George said:
I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
K

KML

George said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks

Did you forget the brackets by chance?

it should be Me![Combo2]
 
G

Guest

Yes - I rechecked and it is

George

Klatuu said:
Is the name of your control Combo2?
I don't see the problem. This is the most common way to find a value in a
field and make the record found the current record in the form.

George said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks



Klatuu said:
Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub


:

I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
G

Guest

I created a new combo box and inserted the new name - same error message

Klatuu said:
Is the name of your control Combo2?
I don't see the problem. This is the most common way to find a value in a
field and make the record found the current record in the form.

George said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks



Klatuu said:
Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub


:

I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
G

Guest

Something is amiss. Try putting breakpoint in the first line of code in the
sub
Set rst = Me.RecordsetClone
Then in the immediate window, type
?Me.Combo2
See what happens.

George said:
Yes - I rechecked and it is

George

Klatuu said:
Is the name of your control Combo2?
I don't see the problem. This is the most common way to find a value in a
field and make the record found the current record in the form.

George said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks



:

Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub


:

I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
G

Guest

That is not required. Brackets are only required if characters that are not
valid for naming or names that are reserved words are used.

KML said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks

Did you forget the brackets by chance?

it should be Me![Combo2]
 
G

Guest

Is this the line you are having trouble with?
rst.Findfirst "[ID] = " & Me![Combo2]

If it still is a problem with a new control name, it may be a reference
problem.
What version of Access?
Have you checked for missing references?
Are you using DAO or ADO?

George said:
I created a new combo box and inserted the new name - same error message

Klatuu said:
Is the name of your control Combo2?
I don't see the problem. This is the most common way to find a value in a
field and make the record found the current record in the form.

George said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks



:

Private Sub Combo2_AfterUpdate()
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.Findfirst "[ID] = " & Me![Combo2]
If rst.NoMatch Then
MsgBox "Record Not Found"
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
End Sub


:

I am trying to use a combo box to pull up records.
When I select a name in the combo box then leave the
form open and then manually run the query it gives
me the results I want, so I know that part works. I read
to add this statement to the "Afterupdate" on my Combo Box
so I did and I keep getting an error message - which states

"You entered an expression that has an invalid reference to the Recordsetclone
property"

Here is the Afterupdate I added - I changed the Combo box name to mine

Private Sub Combo2_AfterUpdate()
Me.RecordsetClone.Findfirst "[ID] = " & Me![Combo2]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

What am I doing wrong ?

Thanks - George
 
G

Guest

I am running Access 2003 - SP2


Klatuu said:
That is not required. Brackets are only required if characters that are not
valid for naming or names that are reserved words are used.

KML said:
Thanks for the response but now I am getting a new error message

"Method or data member not found"
The foloowing part of the code comes back highlighted " !Combo2 "

Thanks

Did you forget the brackets by chance?

it should be Me![Combo2]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top