473,394 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Filling a continuous form

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
3 3697
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JRT | last post by:
I have a continuous form with 3 comboxes, combo1, combo2 combo3. The choices in combo2 are dtermined the what is selected in combo1 by using a where = combo1 statement. The combo is refreshed...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
1
by: Jimmy | last post by:
I know I've done this before but I can't find where I did it or remember exactly how. The situation is this: There is a form of equipment with primary key EquipID. There a continuous subform of...
3
by: wideasleep | last post by:
I have a subform that's a continuous form. In it I have a combo box that fills a date field. It works great except for one thing. It fills in all the other date fields for each record and the combo...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.