View Full Version : bookmark, not yet clear
deepbreath 06-23-2001, 11:46 PM i have this question before, but i am not clear about it. i have a searchform which displays just the list of names after certain search. what i want to do is when we double click on any of the names, it opens the mainform, which have all the details of the record and then after viewing i can go forward and backward just as i would have done when i open it directly. (when i go through search form it normally displays only one record). an example will be appreciated.
deepbreath@usa.net
Angello Pimental 06-25-2001, 05:16 AM Here is what you want:
Private Sub listofnames_Click()
On Error GoTo Err_listofnames_Click
Dim stDocName As String
Dim rst As Recordset, strCriteria As String
stDocName = "MainForm"
strCriteria = "[Name]=" & "'" & Me![listofnames] & "'"
DoCmd.OpenForm stDocName
Set rst = Forms!MainForm.RecordsetClone
rst.FindFirst strCriteria
Forms!MainForm.Bookmark = rst.Bookmark
Me!listofnames = ""
DoCmd.close acForm, "Search"
Exit_listofnames_Click:
Exit Sub
Err_listofnames_Click:
MsgBox Err.Description
Resume Exit_listofnames_Click
End Sub
Substitute the following;
listofnames: This is the txt box, or listbox, or combo box where the user selects the record he/she wishes to view
mainform: the name of your mainform
Name: Criteria that searches your records, in your case "names"?
HTH
Angelo
deepbreath 06-26-2001, 06:57 AM i tried but it gives a compile error, that a method or data member not found.
also my listofnames is displayed in a subform in datasheet view, from which i want to go to mainform
deepbreath 06-28-2001, 04:33 AM hello waiting for any suggestions
Angello Pimental 06-28-2001, 04:51 AM Ok, lets see.....
Is it possible for you to display the list of names in form view??
If not then I believe that you need to define where your list of names is more accurately.
strCriteria = "[Name]=" & "'" & Me![nameofsubform].[listofnames] & "'"
Could anyone else please give us a suggestion to what need to be done, thanks.
Angelo
deepbreath 06-29-2001, 08:41 AM sorry, still the same error, the code stops and highlight FindFirst......... stuck
D-Fresh 06-29-2001, 09:10 AM open up a module and then go to the tools menu and select references. If anything with a check mark has the mord MISSING by it, uncheck that box. This should do it for you. Hope that helps.
Doug
deepbreath 06-30-2001, 08:09 AM can you be a bit more specific please
deepbreath 07-01-2001, 05:18 AM cannot understand, please help
Angello Pimental 07-02-2001, 04:52 AM Hmmm....
I don't really know what to say..
Could you post the code that you have for us to see?
deepbreath 07-02-2001, 09:40 AM i used the same code you told, with ofcourse the change of names, but it stops and gives the error. if you can direct me or send me some example this will be much appreciated thanx in advance
D-Fresh 07-02-2001, 10:18 AM Do you have the Microsoft DAO Object Library Installed??? To get there, go to the modules tab and either go to design view of an existing module or create a new module. Go to the Tools menu and select references. See if one of the checked items up top are Labeled Microsoft DAO x.x Object Library. If not, then look through the list and check it. Then try again. If you created a new module to get to that menu, then you can close it without saving.
Doug
|
|