473,811 Members | 3,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Go To Current Record

Hello,

I am having difficulty in getting the current record of the current
form to show after pressing a command button that takes me to another
form. The command button takes me to another form that I want to show
the record of the previous form I left.

The problem is that the form does not show any other record but the
current one from the previous form. I want it to open to that current
record and it does however I can only view that record. If I try to
page up or down then it will not let me. I think that there are a few
different ways to do this but I am doing it as a macro.

The macro starts with OpenForm. Then in the where condition I entered
[certificate]=[Forms]![frmECInput]![certificate].
It does work but I want to be able to also use page up down to see
other records. I also saw a command for "ShowAllRecords " but it did
not start at the current record.

Does anybody know how to make all records appear starting with the
current record from another form? I also tried "goto" command but it
did not work either.
thank you,
Tony
Nov 12 '05 #1
2 5324
some different ways to do it:

1. select a record in the form: frmECInput then

when refreshing the screen to sync try resetting the recordsource to
something like:

select * from table where [certificate]>=[Forms]![frmECInput]![certificate]
order by [certificate]
2. or if its closed, then when opening it, pass a where cluase to it like

docmd.openform "formname", "", "[certificate]>='" &
[Forms]![frmECInput]![certificate] & "'"

3. Beware of hard coding names in your app, if something changes then you
would have to change all occurances of what changed, so this is better:

a. define a global variable
Global strCertificate as string

and a function to pass the variable

Public function GetCertificate( ) as string
if len(strCertific ate) = 0 then
strCertificate = "ERROR"
GetCertificate = strCertificate
else
GetCertificate = strCertificate
end if
end function
b. use the selecting form's oncurrent event to keep track of where you are
in frmECInput OnCurrent event
strCertificate = ctlCertificate
c. open/refresh/whatever the selected form
docmd.openform "formname",""," certificate = '" & GetCertificate( ) & "'"

the advantages of this way are you are using good data, and the references
are not hardcoded.
4. Using a class to do your task may or may not apply to your situation. The
above mixes the data and the front end, most access apps do their work this
way. A class enables you to separate the front end, from business rules,
and from the acquisition of data, and from the data itself. ( meaning a
change to the data or business rules does not require changes to the front
end ) I'd explain classes, but if you are using
[Forms]![frmECInput]![certificate] to reference something, get the above to
work and then learn about classes next week.

sorry if i mistyped something, but your get the idea.

John Bickmore
www.BicycleCam.com
www.Feed-Zone.com

"Tony" <et*@wt.net> wrote in message
news:ad******** *************** ***@posting.goo gle.com...
Hello,

I am having difficulty in getting the current record of the current
form to show after pressing a command button that takes me to another
form. The command button takes me to another form that I want to show
the record of the previous form I left.

The problem is that the form does not show any other record but the
current one from the previous form. I want it to open to that current
record and it does however I can only view that record. If I try to
page up or down then it will not let me. I think that there are a few
different ways to do this but I am doing it as a macro.

The macro starts with OpenForm. Then in the where condition I entered
[certificate]=[Forms]![frmECInput]![certificate].
It does work but I want to be able to also use page up down to see
other records. I also saw a command for "ShowAllRecords " but it did
not start at the current record.

Does anybody know how to make all records appear starting with the
current record from another form? I also tried "goto" command but it
did not work either.
thank you,
Tony

Nov 12 '05 #2
John,

Thank you for your reply. I will try that first one to see if it works.
I am not too familiar with all of the other ones because I am just a
novice user of access but I certainly want to learn a lot more.

Thank you,
Tony

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8823
by: Tony | last post by:
I have a form in access that has 5 fields for a certain record: 1)Date mailed, 2)Date received, 3)Date completed 4)Foreign Content amount and 5)record number. If the foreign content (FC)is >15% of the invoice amount (inv amt.on another form) then I want a my report to run automatically for the record I am on in the current EC Input form when I enter in the foreign content amount. I have a query built for the report. Currently, when the...
4
4165
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I want all of the controls in whatever is the CURRENT record to have it's data bolded on the screen. (Question #1: Is there a SIMPLE way to refer to the Current Record?) I've been trying to use a Bookmark to specify the current record, but it
3
7830
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command acCmdDelete Record? Thanks! Maria
8
12121
by: Zlatko Matiæ | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the combobox. What is the solution? Thank you in advance.
1
2972
by: 4004 | last post by:
I would like to open a columnar form (so I can see all the details) from a datasheet form (so I can see what is there) but keep the same recordset and current record. I can do the recordset set part (stlinkcriteria) - but how do I have the new form open on the record that was current in the datasheet form? I don't want to filter to the current record when the 2nd form opens - I would like to be able to keep the whole rs and be able to...
5
6998
by: christianlott1 | last post by:
I admit my form is pretty complex and may need a total overhaul - I have two subforms synchronized on a form through an unbound text box. When I enter a new record in the second subform it used to complain about nulls and then about 'can't repeat an index'. To solve this I wrote code on the main form's subform enter event (I'm surprised I found it. I must have spent an hour trying to program the enter and exit events from the subform...
1
4344
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same logic for a date field. i.e. theValue.defaultvalue = "#" & theValue.value & "#" I can't get this to work for some reason and I can't figure out why. Can anyone out there help? Thanks Repeat value of previous record field into current...
5
7394
by: eighthman11 | last post by:
Hi everyone: This is probably a pretty simple problem but it is driving me nuts. Using Access 2000. I have a continuous form which list several thousand inventory items. The user can enter a order quantity on any given line. I have several different error checks depending on what the user enters in the quantity text box. What I need is a way to keep the user on that current record if he has any errors. This needs to be done if he...
6
2930
by: MLH | last post by:
Cut this little FN out-a-Access 97 HELP. It makes mention of the new record being made the current record. Is it the Update method responsible for that - or the Bookmark method? Which one? Function AddName(rstTemp As Recordset, _ strFirst As String, strLast As String) ' Adds a new record to a Recordset using the data passed ' by the calling procedure. The new record is then made
0
9734
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10398
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10416
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9215
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7676
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5702
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.