Solved

Manipulating Records

Posted on 2000-03-20
2
154 Views
Last Modified: 2010-05-02
How do i move from one record to the other. I tried using movelast, moveprevious,movenext and movefirst, in visual basic 6.0. The records are in the table in a database(ACCESS 2000). I have used the following code and nothing is happening
 " Private sub mnuMoveFirst_()
    rsaddstaff.movefirst
    StaffRecord.visible = true
  End Sub"

where: rsaddstaff is a recordset
       Staffrescord is a form name

 
0
Comment
Question by:bellamoahi
2 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 2636531
Moving to the new record doesn't automatically update the screen if you're not using bound controls. You should have some code to copy the record's fields to the controls for display:

Text1.Text = trim("" & rs!MyFieldName)

repeat for all fields in the set.

Conversely you can use bound controls, but I find the above method more controllable.

M
0
 
LVL 1

Accepted Solution

by:
simonstre earned 50 total points
ID: 2637493
I would declare ur recordset as this:


Dim rsAddStaff as new adobd.recordset
rsAddStaff.open "select * from [Table Name]",YourConnectionString,adopendynamic, adlockoptimistic

rsAddStaff.refresh 'To be sure that the record is up to date.  It will be positionned at the first record.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now