-
Jul 18th, 2015, 11:54 AM
#1
Thread Starter
New Member
-
Jul 18th, 2015, 12:18 PM
#2
Re: DataGrid cannot show all entries from Access!!
You would have to show some code. A picture tells us nothing about what is going on in the code. How many records are you expecting? What query are you using, how are you getting the data into the grid? What other code do you have if any that may be causing a problem with the grid?
-
Jul 18th, 2015, 12:58 PM
#3
Thread Starter
New Member
Re: DataGrid cannot show all entries from Access!!
Originally Posted by DataMiser
You would have to show some code. A picture tells us nothing about what is going on in the code. How many records are you expecting? What query are you using, how are you getting the data into the grid? What other code do you have if any that may be causing a problem with the grid?
Code:
Dim conexion As New ADODB.Connection
Dim registros As New ADODB.Recordset
Private Sub Form_Load()
Set DataGrid1.DataSource = registros
If conexion.State <> 1 And registros.State <> 1 Then
conexion.CursorLocation = adUseClient
conexion.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data source=" & App.Path & "\dbInventario.mdb"
registros.CursorLocation = adUseClient
registros.Open "SELECT * FROM Prestaciones ORDER BY IdPrestamo ASC", conexion, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = registros
End If
End Sub
Private Sub cmdUltimo_Click()
On Error GoTo error
registros.MoveLast
Busqueda.MoveLast
error:
Label1.Caption = "Ultimo"
Exit Sub
End Sub
Private Sub cmdPrimer_Click()
On Error GoTo error
registros.MoveFirst
Busqueda.MoveFirst
error:
Label1.Caption = "Primero"
Exit Sub
End Sub
Private Sub cmdSiguiente_Click()
On Error GoTo error
registros.MoveNext
Busqueda.MoveNext
error:
Label1.Caption = "Seleccionado"
Exit Sub
End Sub
Private Sub cmdAnterior_Click()
On Error GoTo error
registros.MovePrevious
Busqueda.MovePrevious
error:
Label1.Caption = "Seleccionado"
Exit Sub
End Sub
That's the specific code for the datagrid
-
Jul 18th, 2015, 12:59 PM
#4
Thread Starter
New Member
Re: DataGrid cannot show all entries from Access!!
I mean, it actually show all of them, but I can't see them because the SCROLL BAR doesn't moves down....
-
Jul 18th, 2015, 01:10 PM
#5
Re: DataGrid cannot show all entries from Access!!
Almost looks like the datagrid doesn't know how many records are in the grid? Does the grid have a refresh method? If so, try that after you assign the recordset. Just a thought & easy enough to test
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|