Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use dataenvironment to call up records

Status
Not open for further replies.

DannyTmoov2

IS-IT--Management
Jan 7, 2003
49
GB
Hi all, I have an AccessXP database, am trying to use dataenvironment to call up records into text boxes in a VB6 project.

I have set up a simple form with 2 text boxes pointing at 2 fields in a table (using datasource as the dataenvironment, data member as the table and datafield as the field).

On the form I use the following code: -

Private Sub Form_Load()
dePMIS.rsTABLENAME.Open
dePMIS.rsTABLENAME.MoveFirst
End Sub

However I can not see the field values in the text boxes, however I believe the table is being accessed because if I add some next and previous buttons: -

Private Sub Command1_Click()
dePMIS.rsTABLENAME.MoveNext
End Sub

Private Sub Command2_Click()
dePMIS.rsTABLENAME.MovePrevious
End Sub

I can click through the same number of times as there are records before getting the EOF error.

Pleeeeeeeeeeeeeaaaaaaaaaaaaassssseeee help, its driving me mad!

Could it be a driver issue? I am using XP pro- SP1, with VB6 using JET 4.0

Thanks in advance if anyone can shed any light???????????????????!!!!!

 
Try doing this...

Change
Code:
Private Sub Form_Load()
dePMIS.rsTABLENAME.Open
dePMIS.rsTABLENAME.MoveFirst
End Sub

To
Code:
Private Sub Form_Initialize()
dePMIS.rsTABLENAME.Open
dePMIS.rsTABLENAME.MoveFirst
End Sub

--
Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top