Invalid use of Null

pmathobela

Registered User.
Local time
Tomorrow, 00:18
Joined
Feb 18, 2011
Messages
20
Hi All,

Please help me with the below code. The code below is suppose to open a form with selected inform on a subform. When I try running it i get 'invalid use of nulll', and when debbuging it highlites the line where I assign ID(which is an autogenerated number) to the variable lngBookmark.

******
Dim rs As Object
Dim lngBookmark As Long

'set a variable to the current record
lngBookmark = ID

'open the new form
DoCmd.OpenForm "Interview"

'take it to the selected record
Set rs = Forms!Interview.RecordsetClone
'rs.FindFirst "[ID] =" & lngBookmark
rs.FindFirst ID = lngBookmark
Forms!Interview.Bookmark = rs.Bookmark
Set rs = Nothing

*******

Thanx!
 
Bookmarks are strings and you also can't set the bookmark of a subform to the bookmark of the main form (it would have no meaning as a bookmark is ONLY good within the context of the current recordset).

If you have the Master/Child links set you shouldn't have to try to do this. You should be able to just select the record from the master and the child records will be gathered in the subform.
 

Users who are viewing this thread

Back
Top Bottom