473,508 Members | 2,365 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 5291
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(strCertificate) = 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.google.c om...
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
8808
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...
4
4119
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...
3
7805
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...
8
12066
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...
1
2950
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...
5
6958
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...
1
4325
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...
5
7370
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...
6
2919
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? ...
0
7223
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
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
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...
1
7036
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
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
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...

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.