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

Access 2003 vs Access 2007

The is a simple example of code that worked in access 2003 but does
not in access 2007. I have checked it with the debugger and the
reason is the value of formField1 does not change in ver. 2007 in the
code as the docmd.gotorecord,,acnext moves down the records. But it
does in ver 2003. Any Suggestions?

Example of Table displayed in a continous form with 5 records.
1
1
1
2
3

Example Code:

When double Clicking on the 1st record the cursor should move to
record 4.

Private Sub formField1_DblClick(Cancel As Integer)
dim vTest as Byte

vTest = 1

Do While [formField1] = vTest
DoCmd.GoToRecord , , acNext
Loop

End Sub

Thanks.
Aug 21 '08 #1
12 4172
Microsoft spent big bucks developing and streamlining the Access/
Windows GUI, including scrollbars and default navigation buttons. They
are fast, slick, and, TTBOMK, foolproof. Use them!
Forms are for editing data, not silly buttons.

On Aug 20, 10:12*pm, pballou <pbal...@nctc.comwrote:
>*Any Suggestions?
Aug 21 '08 #2
On Aug 20, 9:28*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
Microsoft spent big bucks developing and streamlining the Access/
Windows GUI, including scrollbars and default navigation buttons. They
are fast, slick, and, TTBOMK, foolproof. Use them!
Forms are for editing data, not silly buttons.

On Aug 20, 10:12*pm, pballou <pbal...@nctc.comwrote:
*Any Suggestions?- Hide quoted text -

- Show quoted text -
I just simplified the code to make it easy to understand the problem.
I am doing alot more than just trying to move down the page. It is
part of scheduling program that moves through dates and times to find
open time slots. With that being said do you have any ideas why the
values from the form are not changing??
Aug 21 '08 #3
I don't see why the code would not work in 07.

I would do a few things:

first, do a debug->compile while looking at the code. Does it compile?

And, you could try:

try using me.formField1 in place of [formField]. Or even me!FormField1
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Aug 21 '08 #4
I don't see why the code would not work in 07.

I would do a few things:

first, do a debug->compile while looking at the code. Does it compile?

And, you could try:

try using me.formField1 in place of [formField]. Or even me!FormField1

And, if it has spaces, then perhaps try:

me![FormField]

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com

Aug 21 '08 #5
pballou wrote:
The is a simple example of code that worked in access 2003 but does
not in access 2007. I have checked it with the debugger and the
reason is the value of formField1 does not change in ver. 2007 in the
code as the docmd.gotorecord,,acnext moves down the records. But it
does in ver 2003. Any Suggestions?

Example of Table displayed in a continous form with 5 records.
1
1
1
2
3

Example Code:

When double Clicking on the 1st record the cursor should move to
record 4.

Private Sub formField1_DblClick(Cancel As Integer)
dim vTest as Byte

vTest = 1

Do While [formField1] = vTest
DoCmd.GoToRecord , , acNext
Loop

End Sub

Thanks.
Why is vTest set to 1? Why not set vTest to the value of formField1? Ex:

dim vTest as Variant 'have no idea what formField1 is

vTest = Me![formField1]

Do While Me![formField1] = vTest
DoCmd.GoToRecord , , acNext
Loop

BTW, are you updating formField1 as you loop thru the code? Your
description of your problem, what is occurring, what should occur could
use some fleshing out. Why should the value change? Until you provide
a better detailing I believe you'll get some stabs and guesses at what
you are attempting to do as a fix, not a real solution.

Aug 21 '08 #6
On Aug 20, 9:49*pm, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@msn.com>
wrote:
I don't see why the code would not work in 07.

I would do a few things:

first, do a debug->compile while looking at the code. Does it compile?

And, you could try:

* *try using me.formField1 in place of [formField]. Or even me!FormField1

--
Albert D. Kallal * *(Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKal...@msn.com
Thanks for your suggestions.

Sorry I replied to Author instead of reply.

I don't submit very many questions to the groups.
Normally I can find my answers just by reading other people's
questions.

This one has stumped me.

It will compile and I tried the me. and me! reference. Still no
luck.
I've been trying everything for a couple of days.

This has been working fine at about 7 customers for several years.
One of my customers had their computers stolen and upgraded to 2007
and I tested the program and found this problem. In my scheduling
program the docmd.gotorecord,,acnext moves down and back up the form
to record the dates and times already scheduled.

Any other ways to move up and down a form other than
"Docmd.GotoRecord,,acNext"?
I've already tried sendkeys with the down arrow and the tab key. It
will move but it will still no change in the value.

I've put in a msgbox after each move statement to see if it is moving
and it does but no value changed. It's like it gets the first
record's value but never updates as it moves.

Any suggestions would be greatly appreciated.

Thanks
Aug 21 '08 #7
You certainly can writet he code differt. I would perahps change the vTest
as byte to

dim vTest as Varient and see if that works.

I assume that other code in the application runs fine??

I am perplexed why your code don't work. There nothing inhenerent in 2007
that changed that should cause a problem.

You could rewrite the code as:

Dim rst As DAO.Recordset
Dim vTest As Variant

vTest = 1
Set rst = Me.Recordset
Do While rst!FormField1 = vTest
rst.MoveNext
Loop

Note that you need to replace "formField1" with the actual name of the
underlying field in the table, NOT the actual name of the contorl used on
the form (often they are the SAME name, but often they are not).

Does most other code run just fine in the application?

Try the above..it should work

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Aug 21 '08 #8
pballou wrote:
On Aug 20, 9:49 pm, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@msn.com>
wrote:
>>I don't see why the code would not work in 07.

I would do a few things:

first, do a debug->compile while looking at the code. Does it compile?

And, you could try:

try using me.formField1 in place of [formField]. Or even me!FormField1

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKal...@msn.com


Thanks for your suggestions.

Sorry I replied to Author instead of reply.

I don't submit very many questions to the groups.
Normally I can find my answers just by reading other people's
questions.

This one has stumped me.

It will compile and I tried the me. and me! reference. Still no
luck.
I've been trying everything for a couple of days.

This has been working fine at about 7 customers for several years.
One of my customers had their computers stolen and upgraded to 2007
and I tested the program and found this problem. In my scheduling
program the docmd.gotorecord,,acnext moves down and back up the form
to record the dates and times already scheduled.

Any other ways to move up and down a form other than
"Docmd.GotoRecord,,acNext"?
Dim rst = Me.Recordsetclone
rst.bookmark = me.bookmark
Do while not rst.eof
rst.movenext
If field <var then exit do
Loop
if rst.eof then rst.moveprevious
me.bookmark = rst.bookmark
I've already tried sendkeys with the down arrow and the tab key. It
will move but it will still no change in the value.
I've put in a msgbox after each move statement to see if it is moving
and it does but no value changed. It's like it gets the first
record's value but never updates as it moves.

Any suggestions would be greatly appreciated.
Yeah. Tell us what you want to do. What's all this about "change in
the value" stuff mean.

>
Thanks
Aug 21 '08 #9
Checking this it !!!SEEMS!!! that Access 2007 code does !!!NOT!!!
return the value of a textbox in the record to which we have moved
with DoCmd.GoToRecord from !!!WITHIN!!! the procedure where the
DoCmd.GoToRecord lives (after the DoCmd.GoToRecord is called). It
continues with the original value of the text box in the record before
DoCmd.GoToRecord is called. This is as the OP reported.

I was successful in retrieving this value only in the form's OnCurrent
event code as follows:
(Northwinds 2007 - Form:Purchase_Order_List

Dim SupplierID&

Private Sub Form_Current()
SupplierID = Supplier_ID.Value
End Sub

Private Sub Purchase_Order_ID_Click()
Dim TestSupplierID&
TestSupplierID = Supplier_ID.Value
Do
DoCmd.GoToRecord
If SupplierID <TestSupplierID Then Exit Do
Loop
End Sub

(What does this do? It moves down the continuous form while the
supplier is the same supplier as in the record where we started).

Have I tested this notion thoroughly? Nope!
Is the behaviour different than in earlier versions of Access? TTBOMR,
yes, but I didn't test that.
Could the OP solve his problem with my code modified? Maybe; my guess
is "Yes".
Could my code be streamlined. Sure. Go ahead!

On Aug 20, 10:41*pm, pballou <pbal...@nctc.comwrote:
On Aug 20, 9:28*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
Microsoft spent big bucks developing and streamlining the Access/
Windows GUI, including scrollbars and default navigation buttons. They
are fast, slick, and, TTBOMK, foolproof. Use them!
Forms are for editing data, not silly buttons.
On Aug 20, 10:12*pm, pballou <pbal...@nctc.comwrote:
>*Any Suggestions?- Hide quoted text -
- Show quoted text -

I just simplified the code to make it easy to understand the problem.
I am doing alot more than just trying to move down the page. *It is
part of scheduling program that moves through dates and times to find
open time slots. *With that being said do you have any ideas why the
values from the form are not changing??
Aug 21 '08 #10
On Aug 21, 4:35*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
Checking this it !!!SEEMS!!! that Access 2007 code does !!!NOT!!!
return the value of a textbox in the record to which we have moved
with DoCmd.GoToRecord from !!!WITHIN!!! the procedure where the
DoCmd.GoToRecord lives (after the DoCmd.GoToRecord is called). It
continues with the original value of the text box in the record before
DoCmd.GoToRecord is called. This is as the OP reported.

I was successful in retrieving this value only in the form's OnCurrent
event code as follows:
(Northwinds 2007 - Form:Purchase_Order_List

Dim SupplierID&

Private Sub Form_Current()
* * SupplierID = Supplier_ID.Value
End Sub

Private Sub Purchase_Order_ID_Click()
* * Dim TestSupplierID&
* * TestSupplierID = Supplier_ID.Value
* * Do
* * * * DoCmd.GoToRecord
* * * * If SupplierID <TestSupplierID Then Exit Do
* * Loop
End Sub

(What does this do? It moves down the continuous form while the
supplier is the same supplier as in the record where we started).

Have I tested this notion thoroughly? Nope!
Is the behaviour different than in earlier versions of Access? TTBOMR,
yes, but I didn't test that.
Could the OP solve his problem with my code modified? Maybe; my guess
is "Yes".
Could my code be streamlined. Sure. Go ahead!

On Aug 20, 10:41*pm, pballou <pbal...@nctc.comwrote:
On Aug 20, 9:28*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
Microsoft spent big bucks developing and streamlining the Access/
Windows GUI, including scrollbars and default navigation buttons. They
are fast, slick, and, TTBOMK, foolproof. Use them!
Forms are for editing data, not silly buttons.
On Aug 20, 10:12*pm, pballou <pbal...@nctc.comwrote:
*Any Suggestions?- Hide quoted text -
- Show quoted text -
I just simplified the code to make it easy to understand the problem.
I am doing alot more than just trying to move down the page. *It is
part of scheduling program that moves through dates and times to find
open time slots. *With that being said do you have any ideas why the
values from the form are not changing??- Hide quoted text -

- Show quoted text -
Lyle, You are the MAN!

This is exactly what I needed and I would never have found it.

Thanks.
Aug 22 '08 #11
Salad <oi*@vinegar.comwrote in
news:4Y******************************@earthlink.co m:
Dim rst = Me.Recordsetclone
rst.bookmark = me.bookmark
Do while not rst.eof
rst.movenext
If field <var then exit do
Loop
if rst.eof then rst.moveprevious
me.bookmark = rst.bookmark
Please don't recommend that people write code like that. Instead:

With Me.RecordsetClone
.Bookmark = Me.Bookmark
Do While Not .EOF
.Movenext
If field <var then exit do
Loop
If .EOF then .MovePrevious
Me.Bookmark = .Bookmark
End With

But if you *do* recommend unnecessarily initializing a recordset
variable, be sure that you clean up by ending your code with:

Set rst = Nothing

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 22 '08 #12
pballou <pb*****@nctc.comwrote in
news:67**********************************@f63g2000 hsf.googlegroups.co
m:
I am doing alot more than just trying to move down the page. It
is part of scheduling program that moves through dates and times
to find open time slots.
It is likely that you should be able to get the answer with SQL
instead of jumping around in a form's recordset (or RecordsetClone).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 22 '08 #13

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

Similar topics

27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
3
by: Paul H | last post by:
Most of my projects are developed in Access 2003. I have not even installed Office 2007 yet! I need to buy VSTO to get the run-time licence for Access 2003. No doubt I will soon need a run-time...
2
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
1
prn
by: prn | last post by:
Hi folks, I'm relatively new to Access, but I seem to have drawn the short straw, so I have the assignment for my workplace of looking for problems/inconsistencies in migrating applications to...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
8
by: elias.farah | last post by:
Hello Everyone, I'm having some very weird behavior on a couple of Access forms. (Not all forms, just some of them). The forms have been working for years, under Access XP/2003 etc, and last...
6
by: tony.abbitt | last post by:
I have recently installed Office 2007 (SP1) retaining the previous installation of Office 2003. I have converted an Access 2003 database to Access 2007. The database contains the VBA code...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
0
geolemon
by: geolemon | last post by:
I developed an Access database on my laptop, which has Access 2003. The workstations in our office have Office 2007 installations, which did not include Access (Student and Teacher edition...
5
by: Lysander | last post by:
My collegue had to buy a new laptop that came with Office 2007 already installed. She had Access 2003 installed on top, in a different directory. None of our 2003 databases will run on her...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...

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.