Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

EOF Formate

Posted on 1998-06-17
5
301 Views
Last Modified: 2010-05-03
"Data1.Recordset.MoveNext or MovePrevious" When  I type this code and hit the command button, I get error message. I know that  I need to Type EOF or BOF for each data control but I don't know how, can you please email me the code for EOF and BOF to dispaly my database within VB without getting an error message. Thanks
my email is   Hadorth11@aol.com
Thanks
0
Comment
Question by:hak66
5 Comments
 
LVL 1

Expert Comment

by:khaledc
ID: 1463634
You may have to open the record first, can tell me what are you exactly trying to achieve, may be I can help.
0
 
LVL 1

Expert Comment

by:KEWL
ID: 1463635
I goes something like this ...

IF EOF(#filenumber) then exit do

0
 

Accepted Solution

by:
cerik earned 50 total points
ID: 1463636
If you are useing a recordset form a data control as it looks, then the two functions BOF and EOF, return a boolean if the current recordset is Before the begining of file (BOF), or At the End of the File (EOF). If you want to use these, then the syntax goes like this

'for MoveNext
if Data1.Recordset.EOF then exit do '/sub/function or whatever you are in
'and for Moveprevious
if Data1.Recordset.BOF then exit do

I will also mail this to you.
0
 

Expert Comment

by:electrick
ID: 1463637
Try placing this code in your command button's click event:
If Data1.Recordset.EOF = True or Data1.Recordset.BOF = True Then
    Exit Sub
End If

Data1.Recordset.MoveNext
or
Data1.Recordset.MovePrevious

0
 

Author Comment

by:hak66
ID: 1463638
Thanks, I will be contacting you after I try it. I appreciate your time and consideration!!!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question