By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Filling a continuous form

P: n/a
Leo
Hi everybody,

Is there a way to fill a continuous form with an ADO recordset?
Normally when I populate the form with the recordset only the first record
is shown. I want to fill all records.
Thanks for your help.

Leo
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Leo wrote:
Hi everybody,

Is there a way to fill a continuous form with an ADO recordset?
Normally when I populate the form with the recordset only the first record
is shown. I want to fill all records.
Thanks for your help.


What's the code you use to fill the form?

Does the recordset have multiple records? If there is only one record,
it will only fill one "record" of the continuous form.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2

P: n/a
Leo
The recordset has multiple records and I use a Sub to populate the form just
like:
If Not rsCustomer.BOF And Not rsCustomer.EOF Then
Me.CustomerCode = rsCustomer!CustomerCode
Me.CustomerName = rsCustomer!CustomerName,
etc..
End If
There is of course an error handler and other regular things in the Sub.
This Sub is called by form_load procedure.
"MGFoster" <me@privacy.com> wrote in message
news:W4****************@newsread3.news.pas.earthli nk.net...
Leo wrote:
Hi everybody,

Is there a way to fill a continuous form with an ADO recordset?
Normally when I populate the form with the recordset only the first
record is shown. I want to fill all records.
Thanks for your help.


What's the code you use to fill the form?

Does the recordset have multiple records? If there is only one record, it
will only fill one "record" of the continuous form.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Nov 13 '05 #3

P: n/a
Leo wrote:
The recordset has multiple records and I use a Sub to populate the form just
like:
If Not rsCustomer.BOF And Not rsCustomer.EOF Then
Me.CustomerCode = rsCustomer!CustomerCode
Me.CustomerName = rsCustomer!CustomerName,
etc..
End If
There is of course an error handler and other regular things in the Sub.
This Sub is called by form_load procedure.
"MGFoster" <me@privacy.com> wrote in message
news:W4****************@newsread3.news.pas.earthli nk.net...
Leo wrote:
Hi everybody,

Is there a way to fill a continuous form with an ADO recordset?
Normally when I populate the form with the recordset only the first
record is shown. I want to fill all records.
Thanks for your help.


What's the code you use to fill the form?

Does the recordset have multiple records? If there is only one record, it
will only fill one "record" of the continuous form.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you are using Access 2000, or a higher version, then you should set
the Form's Me.Recordset to the ADO recordset. I got the following
example from the MS Knowledge Base (KB) site:

Sub Form_Open(Cancel As Integer)
' Purpose:
' Assign an ADO recordset to the Recordset property of an
' MS Access 2000 form.
' Note:
' This code must be in the Form's Form_Open() event procedure.
' Source:
' MS KB Article Q227053
' Modified:
'

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
With cn
.Provider = "MSDataShape"

'The code below uses a sample server name, user ID, and password.
'Be sure to use your actual server name, user ID, and password.

.ConnectionString = "DATA PROVIDER=SQLOLEDB;DATA " & _
"SOURCE=MySQLServerName;DATABASE=Pubs;UID=sa;PWD=; "
.CursorLocation = adUseServer
.Open
End With

Set rs = New ADODB.Recordset
With rs
.Source = "SELECT * FROM Authors"
.ActiveConnection = cn
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open
End With

Set Me.Recordset = rs
' If the rs.Source was a JOINed query the table w/ the unique
' records would be set to .UniqueTable.
Me.UniqueTable = "Authors"

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA+AwUBQizIWoechKqOuFEgEQJW7ACgoEvxmsgHKuVA7q1stS VxMuO5ObQAmK20
pjUZmKaCkDVwx0yGZzdfU+Y=
=Tw/V
-----END PGP SIGNATURE-----
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.