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!

Data environment Problem

Status
Not open for further replies.

DannyTmoov2

IS-IT--Management
Jan 7, 2003
49
GB
I have an access database (db1), and i'm trying to use a data environment (de1)to view details of a table (table1). I've successfully set up the data environment and can drag and drop the fields onto a dummy form, however I can't seem to view any of the records. In the form I use the following code with the aim to simply load the data and cycle through the records:

Private Sub Command3_Click()
de1.rstable1.Open
End Sub

Private Sub Command1_Click()
de1.rstable1.MoveNext
End Sub

Private Sub Command2_Click()
de1.rstable1.MovePrevious
End Sub

something seems to be working because I can click the next button x amount of times but if I then click the back button x+1 times I get the BOF error indicating that i've gone past the 1st record. However none of the fields are visible and the textboxes remain blank.

Any ideas would be VERY much appreciated as i'm going out of my mind!

Thanks
dan

 
Check that the dataenviroment is showing in the properties for each text box and the correct firld name is in each box
I usually set up a datacontrol on the form and have the dataenvironment as its recordsource
I then have this datacontrol as the source for the text boxes or datagrids I want.
You then get a little arrow box for scrolling thru the records etc
You can use the recordset property of the datacontrol for code instead of manipulating the dataenvironment directly.
The dataenvironment is very trick if you want to change any data in the original database from your form.

 
This is the problem, I am revisiting an Old VB project (from about 5 months ago), that i developed on another machine and it worked fine (lots of trick data environment efforts). All I can tell now is that there are more modern fox drivers available but even when selecting the old ones id wont work.

Please anyone... I'm going to stick my finger in my eye in a minute!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top