473,408 Members | 1,854 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,408 software developers and data experts.

Passing bookmarks between modules...

patjones
931 Expert 512MB
Hi:

I have a form in my Access project called "frmWC", and a form called "frmModifyClaim". In frmWC, I set a bookmark like so:

Set rst = Me.RecordsetClone

rst.FindFirst "[tblWC].[fldClaimNum] = '" & Me![cmbSelectClaimNum] & "'"

Me.Bookmark = rst.Bookmark

What I want to be able to do is open frmModifyClaim, and have it go to the same record that is showing on frmWC...in other words pass this bookmark on to frmModifyClaim.

How can this be accomplished?

Thank you!

Pat
Jul 16 '07 #1
5 1580
ADezii
8,834 Expert 8TB
Hi:

I have a form in my Access project called "frmWC", and a form called "frmModifyClaim". In frmWC, I set a bookmark like so:

Set rst = Me.RecordsetClone

rst.FindFirst "[tblWC].[fldClaimNum] = '" & Me![cmbSelectClaimNum] & "'"

Me.Bookmark = rst.Bookmark

What I want to be able to do is open frmModifyClaim, and have it go to the same record that is showing on frmWC...in other words pass this bookmark on to frmModifyClaim.

How can this be accomplished?

Thank you!

Pat
  1. Declare a Public Variable in a Standard Code Module as follows:
    Expand|Select|Wrap|Line Numbers
    1. Public strClaimNum As String
  2. Add this additional line of code:
    Expand|Select|Wrap|Line Numbers
    1. Set rst = Me.RecordsetClone
    2. rst.FindFirst "[tblWC].[fldClaimNum] = '" & Me![cmbSelectClaimNum] & "'" 
    3. Me.Bookmark = rst.Bookmark
    4.  
    5. '>>>>>>>>>>>>> additional line of code here >>>>>>>>>>>>>
    6. strClaimNum = Me![cmbSelectClaimNum]
  3. In the Open() Event of frmModifyClaim, enter the following code lines:
    Expand|Select|Wrap|Line Numbers
    1. 'Substitute the appropriate Field name for Claim Number
    2. Me![txtClaimNumber].SetFocus
    3. DoCmd.FindRecord strClaimNum
  4. You will advance directly to the same Claim Number in frmModifyClaim.
  5. Good Luck!
Jul 16 '07 #2
MikeTheBike
639 Expert 512MB
Hi

stDocName = "frmModifyClaim"
stLinkCriteria="fldClaimNum = '" & cmbSelectClaimNum & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

???


MTB
Jul 17 '07 #3
ADezii
8,834 Expert 8TB
Hi

stDocName = "frmModifyClaim"
stLinkCriteria="fldClaimNum = '" & cmbSelectClaimNum & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

???


MTB
MTB, the only problem with this approach is that the Form will be Filtered for the specific stLinkCriteria and will only display a single Record. In the other approach, all Records for the underlying Record Source of the Form are displayed, but the Record for the specified Claim Number will now be the Current Record. This will basically mimic the Bookmark functionality.
Jul 17 '07 #4
patjones
931 Expert 512MB
Hi:

Thanks for your responses! I'm going to try both approaches. At first glance, I don't have a problem with MTB's method, because in frmModifyClaim I want to work with one record only...i.e. the claim that the end user wants to modify. Unless you were referring to something else?

In other words, in frmWC, a particular person can have more than one claim, and chooses which one to view by picking one from a combo box. After making the selection and populating the form with that claim's data, the user can click on a hyperlink "Modify this claim" to pop up frmModifyClaim and change the information for that claim.

Again, I will try both approaches. I was upgraded to Office 2007 today, so there are a few other more pressing issues to deal with right now :-)

Thanks!

Pat
Jul 18 '07 #5
MikeTheBike
639 Expert 512MB
Hi
Hi:

Thanks for your responses! I'm going to try both approaches. At first glance, I don't have a problem with MTB's method, because in frmModifyClaim I want to work with one record only...i.e. the claim that the end user wants to modify. Unless you were referring to something else?

In other words, in frmWC, a particular person can have more than one claim, and chooses which one to view by picking one from a combo box. After making the selection and populating the form with that claim's data, the user can click on a hyperlink "Modify this claim" to pop up frmModifyClaim and change the information for that claim.

Again, I will try both approaches. I was upgraded to Office 2007 today, so there are a few other more pressing issues to deal with right now :-)

Thanks!

Pat
Yes from your origianal post I thought that was the case.

If you do not want to filter the form opened, but jut got to the specific record as ADezil was proposing then I now use this technique

DoCmd.OpenForm "frmEmployeeDetails"

Form_frmEmployeeDetails.Recordset.FindFirst "ID = " & [ID]

BTW, to answer your initial question, a bookmark is only valid for the specific recordset/form, if you requery or reopen a recorset/form the bookmarks all change because they are generated at that time. Therefore you cannot pass bookmarks between modules/forms or anything else.


MTB
Jul 18 '07 #6

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

Similar topics

14
by: Antoni | last post by:
Hello, I wondered if anyone could offer some guidance over my php script. I was hoping the example would allow the user to click the submit buttons and the item number increment. And when the...
4
by: Chris | last post by:
I'm trying to come up with a not-so-ugly manner of passing many command-line options between modules. I have a Steering.py file, which contains my main() and handles the getopts getting of...
2
by: Thomas Anderson | last post by:
I automatically generate several PDF a night from a DB I manage. Below is a snippet of code that just tweakes the registry settings to store path and filename then prints the PDF. Typically a...
3
by: Lee | last post by:
Hi All How can I pass options from one webpage into another webpage. When the user clicks on the hyperlink I want them to be go to the next page but I need to pass in a number that the next...
0
by: Mark Hayworth | last post by:
In VB6, you could set bookmarks that were in different files/module/classes/documents. When you clicked the flag tool to go to the next bookmark, it would take you there, regardless if that...
3
by: andreas | last post by:
With a vb.net application (vb.net 2003) , I want to make a new word doc where I put several bookmarks and also text in paragraphs following the bookmarks How to do? Thanks for any response
15
by: Francach | last post by:
Hi, I'm trying to use the Beautiful Soup package to parse through the "bookmarks.html" file which Firefox exports all your bookmarks into. I've been struggling with the documentation trying to...
2
by: Alan T | last post by:
I have two bookmarks, eg. beginMark and endMark I need to get the text between these 2 bookmarks, how do I do that? eg. <beginMark> Hello Word! This is Saturday.
3
by: james | last post by:
Hi guys, I create a delegate and pass in a local variable. When the variable is a reference type everything works fine, but when it is a valuetype the delegate uses the value of the last...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.