Continuous Data Form

  • Thread starter Thread starter Doug Bell
  • Start date Start date
D

Doug Bell

Hi,
I am trying to create form that displays data like an Access continuous
dataform rather than using a data grid.

I am thinking that I can achieve this by creating a row of text boxes, one
for each field I need to display. The creating a controls array for the
first n records I show and populate the text boxes. Then setting up a
vertical scroll bar for the number of records in the data table.

As the scroll bar is clicked or dragged, I will need to recreate the
controls array for each record/field.

Is there any easier way to achieve this result?

Thanks

Doug
 
Dough,

See this sample I once made, it looks in my opinion that it can help with
your question.
You will have to use textboxes of course instead of buttons.

I hope this helps?

Cor

\\\You can paste it directly in a created project code
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim start As Integer = 4
Dim top As Integer = 25
Dim i As Integer
Dim nowdate As DateTime = DateTime.Now
Dim mybutton(System.DateTime.DaysInMonth _
(nowdate.Year, nowdate.Month)) As Button
For i = 0 To System.DateTime.DaysInMonth _
(nowdate.Year, nowdate.Month) - 1
mybutton(i) = New Button
mybutton(i).TextAlign = ContentAlignment.MiddleCenter
mybutton(i).Width = 40
mybutton(i).Height = 20
mybutton(i).FlatStyle = FlatStyle.Flat
mybutton(i).BackColor = Drawing.Color.AntiqueWhite
mybutton(i).Location = New System.Drawing.Point(start, top)
mybutton(i).Text = (i + 1).ToString
mybutton(i).Cursor = Cursors.Hand
Me.Controls.Add(mybutton(i))
AddHandler mybutton(i).Click, AddressOf mybutton_Click
AddHandler mybutton(i).MouseHover, AddressOf mybutton_Hoover
AddHandler mybutton(i).MouseLeave, AddressOf mybutton_Leave
start = start + 40
If (i + 1) Mod 5 = 0 Then
top = top + 20
start = 4
End If
Next
End Sub
Private Sub mybutton_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thisbutton As Button = DirectCast(sender, Button)
MessageBox.Show("The day is: " & thisbutton.Text)
End Sub
Private Sub mybutton_Hoover _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thisbutton As Button = DirectCast(sender, Button)
thisbutton.BackColor = Drawing.Color.AliceBlue
End Sub
Private Sub mybutton_Leave _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thisbutton As Button = DirectCast(sender, Button)
thisbutton.BackColor = Drawing.Color.AntiqueWhite
End Sub
///
 
Thanks Cor.

Is that the way you would tackle the requirement of creating an Access like
continuous form?
 
Doug,

Difficult to answer for me, because I do not know what is an Access like
continuous form.

However you wrote that you thought of building dynamicly textboxes and this
does the same.

Cor
 
What he is asking for Cor, I think is a Data Enabled form with some record
selectors at the bottom to allow you to scan through some records, is this
right Doug ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Terry,

You mean that terrible standard dataform wizard which is in the items?

Cor

"One Handed Man ( OHM - Terry Burns )bl...
 
I think so

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Hi Terry,
Not exactly.

Access allows you to define a form as a continuous form. You then place
controls on the form and bind them to fields of a recordset.
When you open the form it displays the controls with the data from the first
record and then repeats a copy of all the controls populated with data from
the second record and so on to the end of the page. The scroll bar allows
you to scroll down through the record set.
It is like a data grid except that each row does not have to be in line,
each field is in a separate control (text box or check box etc) and all
those controls are repeated.

The code that Cor provided could be the base of a similar looking form
developed in Dot Net. I have done something similar in VB but I was thinking
that possibly there was an easier way in Dot Net. I think ASP.Net provides a
repeater (?) that might do something similar.

Thanks for the replys.

Doug
 
Cor,
Not a wizard but it does use the standard bound form and then allows you to
set its property as a continuos form so that you can format the way that
each field is displayed.
You do need to bind the form to a recordset and the controls to fields. It
looks better than a list box or a dataset view. Good for displaying data
such as Order Number Headers allowing you to select an Order and then drill
in to see the Order's lines etc.


Doug
 
OK, I see. Well, ASP.NET's repeater wont really do what you need.

There is no obvious way to replicate the functionality of Access's
Continuous forms AFAIK.

I am interested to know why it is important to emulate this functionality or
is it that you simply liked the feauture and would like to replicate it.


--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Terry,
I am rewriting a tiered Access solution that buffers data from an IBM AS400
to provide availability when it does its end of day processing. They want
the User Interface to not change.
It does present the data well!

I will attempt to build and populate the text boxes on the fly and see what
sort of performance I can get.

Doug
 
¤ Hi,
¤ I am trying to create form that displays data like an Access continuous
¤ dataform rather than using a data grid.
¤
¤ I am thinking that I can achieve this by creating a row of text boxes, one
¤ for each field I need to display. The creating a controls array for the
¤ first n records I show and populate the text boxes. Then setting up a
¤ vertical scroll bar for the number of records in the data table.
¤
¤ As the scroll bar is clicked or dragged, I will need to recreate the
¤ controls array for each record/field.
¤
¤ Is there any easier way to achieve this result?
¤

Nothing built in to .NET however there is a product that will generate continuous forms from an
Access database project:

http://www.evolutionsoft.co.uk/about.htm

Some third-party Grid controls may support this feature as well.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top