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

I got an "Invalid Operation" error using MoveFirst???

MLH
The error occurred in line #5130. Ideas as to why?
qryITSLetterList returns 1 single record - but I don't
think that should be a problem. Hmmm???

5100 Dim MyDB As Database, rstITSLttrs As Recordset,
rstOtherTable As Recordset
5110 Set MyDB = CurrentDb()
5120 Set rstITSLttrs = MyDB.OpenRecordset("qryITSLetterList",
dbOpenForwardOnly)
5130 rstITSLttrs.MoveFirst
5140 CurrentVehicleJobID = rstITSLttrs!VehicleJobID

Apr 10 '06 #1
3 4879
MoveFirst will be invalid if there are no records.

Try:
Dim rstITSLttrs As DAO.Recordset, rstOtherTable As DAO.Recordset
...
If rstITSLttrs.RecordCount > 0 Then
rstITSLttrs.MoveFirst
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.net> wrote in message
news:8r********************************@4ax.com...
The error occurred in line #5130. Ideas as to why?
qryITSLetterList returns 1 single record - but I don't
think that should be a problem. Hmmm???

5100 Dim MyDB As Database, rstITSLttrs As Recordset,
rstOtherTable As Recordset
5110 Set MyDB = CurrentDb()
5120 Set rstITSLttrs = MyDB.OpenRecordset("qryITSLetterList",
dbOpenForwardOnly)
5130 rstITSLttrs.MoveFirst
5140 CurrentVehicleJobID = rstITSLttrs!VehicleJobID

Apr 10 '06 #2
MLH
That's what's confusing me - there is one record returned
by the query.

xxxxxxxxxxxxxxxxxxxxxxxx

On Mon, 10 Apr 2006 13:38:44 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
MoveFirst will be invalid if there are no records.

Try:
Dim rstITSLttrs As DAO.Recordset, rstOtherTable As DAO.Recordset
...
If rstITSLttrs.RecordCount > 0 Then
rstITSLttrs.MoveFirst


Apr 10 '06 #3
MLH <CR**@NorthState.net> wrote in
news:f7********************************@4ax.com:
That's what's confusing me - there is one record returned
by the query.

xxxxxxxxxxxxxxxxxxxxxxxx

On Mon, 10 Apr 2006 13:38:44 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
MoveFirst will be invalid if there are no records.

Try:
Dim rstITSLttrs As DAO.Recordset, rstOtherTable As
DAO.Recordset ...
If rstITSLttrs.RecordCount > 0 Then
rstITSLttrs.MoveFirst


MLH Sometimes your naivete amazes me.

In the statement
Set rstITSLttrs = MyDB.OpenRecordset("qryITSLetterList",
dbOpenForwardOnly)

what does dbOpenForwardOnly mean to you?

to me it means that you cannot jump from one record to another.
No Gotorecord, no moveprevious, no movefirst.


--
Bob Quintal

PA is y I've altered my email address.
Apr 11 '06 #4

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

Similar topics

0
by: Brian Morris | last post by:
I'm new to .NET and just trying a few things out, like emailing. I created a form in Visual Studio .Net to input some information for generating an email and I'm getting the following error when it...
1
by: Ron | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I...
9
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
2
by: hvaisane | last post by:
Valgrind says ==11604== Invalid read of size 4 ==11604== at 0x8048ABB: main (foo.cc:36) ==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd ==11604== at 0x1B90514F:...
1
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
0
by: colt | last post by:
I have a query that is pretty straightforward and I am trying to generate 5 reports from that query. The reports produce totals by Project Manager, Category, Client, Account Manager and Account...
0
by: Systemino | last post by:
Hallo, I have a site developed on ASP.NET 2.0. It stay on my notebook and it works with a ORACLE database (ver. 9.0). It's all right!! Then I reached my definite site version on IIS 6.0 in...
7
by: EManning | last post by:
Using A2003. I'm receiving this error when returning from a "DoCmd.OpenReport..." statement. I have a tab control with a subform on every tab. The user selects an item from a combobox at the top...
9
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
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
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
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...
0
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
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...

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.