UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Not a valid bookmark?    
 
   
CHKarcher
post Feb 13 2008, 08:56 AM
Post#1



Posts: 504
Joined: 25-October 07
From: Oklahoma


I have a form that has a button that brings up another and displays records based on data on the frst form. The data on the popup form list out cetain records if I double click on a record selection it populates a string of data back to main form and closes.
All is fine
Then when I co to a another subform on the main form and try to enter in data I get
"Not a valid Bookmark"
If I cycle back the main form a record and forwar again I can enter into the subform no proble.
Can any one help with "Not a Valid bookmark"
thanks
steve
Go to the top of the page
 
 
Start new topic
Replies
AndersRD
post Mar 7 2008, 12:30 AM
Post#2



Posts: 3
Joined: 3-March 08



Hi Crystal:
This is a copy of my code. Parts can be cross referenced to supplier's part number, manufactuer's part number, etc.. These are stored in separate tables but linked by a common 'PartID'. All other details of the part are stored in 'tblParts'. The current work around is to add a supplier's part number as well, and, this can be used to retreive the record from 'tblParts' for any newly added records. The first several hundred records can be retreived successfully by entering a 'PartNo' in text box and then click the search button that runs this code, but any newly added records can not.
[code]
On Error GoTo Err_cmdSearch_Click
Set db = CurrentDb
'check parts table for the indicated part
Set rs = db.OpenRecordset("tblParts", dbOpenDynaset)
With rs
.FindFirst "[PartNo] = '" & Me.txtPartSearch & "'"
If .NoMatch = False Then
Me.Bookmark = .Bookmark
intFlag = 1
Else
.FindFirst "[CommonNo] = '" & Me.txtPartSearch & "'"
If .NoMatch = False Then
Me.Bookmark = .Bookmark
intFlag = 1
End If
End If
.Close
End With
If intFlag = 1 Then
Set db = Nothing
Exit Sub
End If
'if not found check for supplier's part number
Set rs = db.OpenRecordset("tblSupplierPart", dbOpenDynaset)
rs.FindFirst "[SupplierPartNo] = '" & Me.txtPartSearch & "'"
If rs.NoMatch = False Then
lngPart = rs!PartID
rs.Close
intFlag = 2
End If
'if not found check for manufacturer's part number
If intFlag <> 2 Then
Set rs = db.OpenRecordset("tblManufacturerPart", dbOpenDynaset)
rs.FindFirst "[ManufacturerPartNo] = '" & Me.txtPartSearch & "'"
If rs.NoMatch = False Then
lngPart = rs!PartID
rs.Close
intFlag = 2
End If
End If
'if not found check for application Specific part number
If intFlag <> 2 Then
Set rs = db.OpenRecordset("tblAppSpecificPart", dbOpenDynaset)
rs.FindFirst "[ApplicationPartNo] = '" & Me.txtPartSearch & "'"
If rs.NoMatch = False Then
lngPart = rs!PartID
rs.Close
intFlag = 2
End If
End If
If intFlag = 2 Then
Set rs = Me.RecordsetClone
rs.FindFirst "PartID = " & lngPart
If rs.NoMatch Then
MsgBox "Record not found"
Else
Me.Bookmark = rs.Bookmark
End If
rs.Close
Set db = Nothing
End If
Exit_cmdSearch_Click:
Exit Sub
Err_cmdSearch_Click:
MsgBox Err.Description
Resume Exit_cmdSearch_Click

End Sub
[/ Code]
Thank you, Roy
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    24th January 2020 - 05:25 PM