search and view record (1 Viewer)

deepbreath

Registered User.
Local time
Today, 04:25
Joined
Apr 18, 2001
Messages
73
i have a form for viewing all the records in which you can go forwards and backwards. the problem i get is when i come to the desired record through another of my search form, it only displays the required record and doesn' show other records, any suggestions
 

charityg

Registered User.
Local time
Today, 04:25
Joined
Apr 17, 2001
Messages
634
Are you arriving at the specific record by filtering? or querying the form? If you don't locate the specific record by using the bookmark property of the form, this is probably the cause for confusion.

Let me know if you need help with the bookmark property

~Charity
 

Angello Pimental

Registered User.
Local time
Today, 04:25
Joined
May 9, 2001
Messages
92
Charity,
I am having the same difficulty, could you please help me with the bookmark property.

I am using the following code:

Private Sub Listofdomainnames_Click()
On Error GoTo Err_Listofdomainnames_Click
Dim stDocName As String
Dim rst As Recordset, strCriteria As String
stDocName = "RealForm"
strCriteria = "[Domain]=" & "'" & Me![Listofdomainnames] & "'"
DoCmd.OpenForm stDocName

Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
Me.Bookmark = rst.Bookmark

Exit_Listofdomainnames_Click:
Exit Sub

Err_Listofdomainnames_Click:
MsgBox Err.Description
Resume Exit_Listofdomainnames_Click
End Sub

I get the error : You entered an expression that has an invalid reference to the RecordsetClone property.

How do I get around this??
Thnx in advance,

Angelo

[This message has been edited by Angello Pimental (edited 06-12-2001).]

[This message has been edited by Angello Pimental (edited 06-12-2001).]
 

charityg

Registered User.
Local time
Today, 04:25
Joined
Apr 17, 2001
Messages
634
Is your form's datasource a table, query, or select statement?

I see you are opening a form. Are you trying to refer to the recordsetclone of RealForm? or the form you are coding in? If you are refering to RealForm you can't use the me identifier.

try changing me to Forms!RealForm.

If you're still having problems, I might be able to figure it out if I can take a peek at the db (take out any sensitive data of course). But let me know either way.


Charity

[This message has been edited by charityg (edited 06-12-2001).]
 

deepbreath

Registered User.
Local time
Today, 04:25
Joined
Apr 18, 2001
Messages
73
my search form is based on a query, in which you select from a list and its takes you to view record form.
 

charityg

Registered User.
Local time
Today, 04:25
Joined
Apr 17, 2001
Messages
634
If you base your form on a query that is only finding the one record you selected in the list, why would you expect to see all records?

You need to set the bookmark property like

Dim rst As Recordset


docmd.openform "main" 'do this if the form isn't already opened
Forms!main.FilterOn = False
Set rst = Forms!main.RecordsetClone
rst.FindFirst "[primkey]=" & Me![lstName].Column(0)

'Column(0) refers to the hidden primary key field in my list box.

Forms!main.Bookmark = rst.Bookmark


Me![lstName] = ""
DoCmd.Close acForm, "frmSearch"
 

deepbreath

Registered User.
Local time
Today, 04:25
Joined
Apr 18, 2001
Messages
73
i tried to use the above code, but it gives error that method or data code not available and stops at FindFirst. any suggestions
 

charityg

Registered User.
Local time
Today, 04:25
Joined
Apr 17, 2001
Messages
634
I'm thinking you need to reference the DAO 3.5 library. In the code window goto Tools, References, and make sure that DAO 3.5 Object library is checked and not missing.
 

Users who are viewing this thread

Top Bottom