HELP!!! SubForm - Record Source / Recordset

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hello,

I'm working on a subform that needs to use an array as it's Record Source. I
can't find a way to do this. The controls on the sub form are unbounded. Is
this possible? or does Access has a Grid Type control to use instead of the
subform? (other than FlexGrid - witch sucks under access).

I need to connect to various tables and generate totals. Due to it's
complexity it cannot be done with a query / sub query approach.

Any help or ideas is appreciated...

Alex
 
Alex said:
Hello,

I'm working on a subform that needs to use an array as it's Record Source.
I
can't find a way to do this. The controls on the sub form are unbounded.
Is
this possible? or does Access has a Grid Type control to use instead of
the
subform? (other than FlexGrid - witch sucks under access).

I need to connect to various tables and generate totals. Due to it's
complexity it cannot be done with a query / sub query approach.

Any help or ideas is appreciated...

Alex

Alex, it is difficult for me to believe that you cannot use a subform to
accomplish whatever you are trying to do. I do understand there are some
limitations that cannot be worked-around with subforms (like the use of
images at the row and header level). But pretty much anything else can be
done using VBA.

You may also want to give a try to the ListView ActiveX Control, which offer
more options and is flexible enough to do almost anything any user wants to
do. Maybe if you give us more details we can be of better help.

-Randy
 
No. You can assign the name of a table or query or a SQL statement to a
form's RecordSource property, or you can assign an ADO or DAO recordset to
the form's Recordset property. I understand that you can build an in-memory,
disconnected ADO recordset 'on-the-fly', perhaps you could do that, put the
data from your array into the recordset, and assign that recordset to the
Recordset property of the form. This is not something that I have tried in
practice, however.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Does anyone know how can I assign a recordset to a subform?

I have tried
Set Forms!frmStatus!StatusSub.Recordset = rsCloneDB
Me!StatusSub.Form.Recordset = rsCloneDB

No luck so far....

Thank you...

Alex
 
I've only very briefly tested this, but it appears to work. 'Form4' is the
subform control, 'Text0' and 'Text2' are controls on the form that is the
source object of the subform control, 'TheID' and 'TheText' are fields in
the recordset ...

Option Compare Database
Option Explicit

Private mrst As ADODB.Recordset

Private Sub Form_Close()

If Not mrst Is Nothing Then
If Not mrst.State = adStateClosed Then
mrst.Close
End If
End If

End Sub

Private Sub Form_Open(Cancel As Integer)

Dim intCounter

Set mrst = New ADODB.Recordset
mrst.Open CurrentProject.Path & "\test.XML"
Set Me.Form4.Form.Recordset = mrst
Me.Form4.Form.Controls("Text0").ControlSource = "TheID"
Me.Form4.Form.Controls("Text2").ControlSource = "TheText"

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Thank you Brendan....

It seem to be recognizing the recordset but it doesn't shows the data. All I
see is #error in each field but the number of rows matches the # of rows in
the recordset.

Thanks for your help....

Regards,

Alex
 
Back
Top