473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Bookmark

I have a form, where i doubleclick on a datarecord, i want to open at form with 3 subform on, the data coms form same table, but if i use this code only data in main form is data form record set, data i subform is data from first recordset.

This is on main form
Expand|Select|Wrap|Line Numbers
  1. Private sub form_open(cancel as integer)
  2. If Not IsNull(Me.OpenArgs) Then
  3.     Dim auto As Long
  4.     Dim rs As Object
  5.  
  6.  
  7.     Set rs = Me.Recordset.Clone
  8.     auto = Val(Me.OpenArgs)
  9.     rs.FindFirst "[auto]=" & auto
  10.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  11. End If
  12. End sub
  13.  
On subform i use the same code, but it will not work

is there a way to make it work ?

Lars
Sep 1 '15 #1

✓ answered by Seth Schrock

Subforms don't get OpenArgs pass do them, so the first condition in your code will always be false and your code won't run. So you would need to change all your references to Me.OpenArgs to Me.Parent.OpenArgs.

By the way, when you post blocks of code, please use CODE tags.

2 1093
Seth Schrock
2,965 Expert 2GB
Subforms don't get OpenArgs pass do them, so the first condition in your code will always be false and your code won't run. So you would need to change all your references to Me.OpenArgs to Me.Parent.OpenArgs.

By the way, when you post blocks of code, please use CODE tags.
Sep 1 '15 #2
thansk, i will remember to /code next time *S*
Sep 1 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Thelma Lubkin | last post by:
With Me!PERSONSLIST.Form.RecordsetClone .FindFirst strID If .NoMatch Then Debug.Print "key " & Key & " nomatch" Exit Sub Else If Me.Dirty Then Me.Dirty = False Debug.Print "A_LOAD bookmark = "...
6
by: Chris | last post by:
I have been learning C and want to write a program and need someone to point me in the write direction. I want to write a program to store all my webpage bookmarks in possibly one file. I want it...
2
by: Alan T | last post by:
How do I make use of the Bookmarks property so that I can write a text at/below the position of a particular bookmark or the first bookmark ? private Microsoft.Office.Interop.Word.Document...
0
by: Alan T | last post by:
My code can select the content of a Word document between 2 bookmarks: if (bookmarks.Exists("first bookmark") & bookmarks.Exists("second bookmark")) { object oFirstBookmark = ("first...
4
by: zzapper | last post by:
Hi, I use an internal bookmark <form method="post" action="${form_action}#mark1"> to return to the correct place in the page. In case of an error I would wish to return to the top of the...
11
by: Tom Clavel | last post by:
I need to make sure that I am on a different record than I just was on, in a DAO recordset. code fragment: 1. strFind = "thisSource = " & tripID & " AND thisTrip = " & tripID 2. ...
0
by: JosAH | last post by:
Greetings, Introduction At this moment we have a TextProcessor, a LibraryBuilder as well as the Library itself. As you read last week a Library is capable of producing pieces of text in a...
12
Seth Schrock
by: Seth Schrock | last post by:
I have the following subroutine that I'm using to bookmark the current record, do a requery of the form, and then go back to the record that I bookmarked. Here is my code: Private Sub FormRefresh()...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.