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

Error When Converting to Access 2007 Record Not Available

I inherited an Access 2003 database runs fine in 2003 but in 2007 I get an error on updating a form. Record Not available on the last statement
!ItemNumber.SetFocus

Does anyone know why Access 2007 is different and any clues on how to get it to work?

Expand|Select|Wrap|Line Numbers
  1. With Forms!frmMain!frmSKUInput.Form
  2.     !WhichSKUCombo.Value = ""
  3.     !WhichSKUList.Value = ""
  4.     .RecordSource = strSQL1
  5.     .Requery
  6.     !WhichSKUList.RowSource = strSQL2
  7.     !WhichSKUCombo.RowSource = strSQL2
  8.     !WhichSKUList.Requery
  9.     !WhichSKUCombo.Requery
  10.     !ItemNumber.SetFocus
  11. End With   
Oct 11 '10 #1
4 1690
jimatqsi
1,271 Expert 1GB
Where do you want to be in the recordset? If at the beginning, try adding a .movefirst after the .requery.

But I suspect the recordset may be empty. Have you tried monitoring through and looking at the value in strSQL1? I don't see you setting any value for that, is that a global variable? If so, it should have a g in the name to indicate that. Ditto strSQL2

Jim
Oct 12 '10 #2
Thanks, I tried adding .movefirst after the requery but it gave me an error, Run-time error '2465' Application-defined or object defined error.

The strSQL statements get initialized just befort the with loop, I just didn't show them to make the code shorter. What I don't get is it all works with 2003.
I just want to go to the first record in the set

Any help would be greatly appreciated

Expand|Select|Wrap|Line Numbers
  1.  strSQL1 = _
  2.     "SELECT tblItem.ID, tblItem.ItemNumber, tblItem.ItemDescription, tblItem.TypeID, tblItem.FamilyID, tblItem.BaseQty, tblItem.BaseUnitID, tblItem.File, tblItem.UnitsPerCase, tblItem.UnitsPerSU, tblItem.QtyPerPallet, tblItem.QPPUOMID, tblItem.Bulk, tblItem.StorLocID, tblItem.WE, tblItem.ForecastPct, tblItem.BulkTruckKg, tblItem.BulkCapicityKg " & _
  3.     "FROM tblCompCat INNER JOIN tblItem ON tblCompCat.ID = tblItem.TypeID " & _
  4.     "WHERE tblCompCat.ClassificationID = " & TypeID & " ORDER BY tblItem.ItemNumber"
  5.  
  6. strSQL2 = _
  7.     "SELECT tblItem.ID, tblItem.ItemNumber, tblItem.ItemDescription " & _
  8.     "FROM tblCompCat INNER JOIN tblItem ON tblCompCat.ID = tblItem.TypeID " & _
  9.     "WHERE tblCompCat.ClassificationID = " & TypeID & " ORDER BY tblItem.ItemNumber" 
Oct 12 '10 #3
jimatqsi
1,271 Expert 1GB
Well, obviously error 2465 on a simple .movefirst tells us something is seriously wrong. I might delete the form and import from a backup copy of the DB and see if it behaves the same way.

Jim
Oct 13 '10 #4
colintis
255 100+
If you are declaring variables within the form's coding module, you can skip all those [Form]! things. As one thing you need to double check, the format that's accepting by Access 2007 and 2003 are different. Such as Forms!frmMain needs to be [Forms]![frmMain].
Oct 15 '10 #5

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

Similar topics

5
by: Kivanç Karaca | last post by:
Hi all ! I am pretty sure this is an easy one but I couldnt find a way to fix it. How can I get rid of the asp.net error saying "Invalid attempt to read when no data is present. " when there is...
7
by: martin DH | last post by:
A user of a database received this error when attempting to open the database on a new computer. The Access database was built in Access 2003 and is being opened in Access 2007. The database is set...
1
by: BulbFresh | last post by:
Hi, Quick one for you, i'm importing a file which has a long date and time format, so once imported i update each date field with the correct format (dd/mm/yyyy). I wrote this in on click of a...
1
by: Anandshr | last post by:
I have a database created in Ms Access 95 file format. now i want to convert it into Ms Access 2000,2002 or 2007 file format. I got the error when converting that database. I've already tried to...
2
by: clintonb | last post by:
Victor said: The double value that I'm trying to convert to GCSMoney (which is implemented as cents) was produced by multiplying a dollar amount by an interest rate to get interest. double...
1
by: fifothekid | last post by:
Hi everybody, I made a primitive cost control database system using Microsoft Access 2007 as a front-end (don't ask my why did I use Microsoft Access!!!) and SQL Server 2005 Enterprise as a back-end...
0
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
0
by: susan | last post by:
i am a bear of very little brain so please don't use too many abbreviations or technical jargon or it might melt alltogether... I have created a database with Access 2007 and saved it, via the...
0
by: simulationguy | last post by:
I have a database the runs fine in Access 2003 but this routine crashes with error 2105 "You can't go to the specified record" in Access 2007 on the last line !itemNumber.SetFocus Any idea why...
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:
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: 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
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,...

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.