R
rocco
Some days ago I started a thread on this forum regarding the design of a
continuous form to be used to show all of the records filled in a table and
giving the possibility to the user to select each row and perform action on
the record (mine is retrieving all of the information from the record and use
them to fill another form where the data can be edited). This can be easily
accomplished through regular continuous form but I stated few requirements:
a) the form should be unbound and the data should be not editable;
b) I hate having that crappy effect of all the text selected when you click
on a textbox to make the form pointing to the chosen record.
The table I’m using to get the data has 13 fields, but I only need 5 of them
to get the data to be displayed in the continuous form. Thus I wrote the SQL
statement to arrange the recordset that will act as recordsource for the
form. Then I made the 5 text boxes I need enabled=false and locked=true, and
this will get rid of that awful effect of having all the text selected when
you click on the control, giving the user the idea he can actually edit the
values.
I bounded these 5 controls to the relative fields from the Form.recordset.
This will give me the desired design but… will also make the “click†event
for each of the control unusable: it doesn’t fire if the control is
enabled=false.
But the “click†event is what I want to use to “select†the record, because
is the more intuitive for this purpouse. I solved by adding on ole filed to
the table and leaving it blank (thus preserving the size of the database) and
changing the SQL statement to add it. Than I added an unbound ole frame
control to the form, right at the beginning of each row (record) and bounded
to this field from the recordsource. I made the background style and border
style for this control transparent. Last I added a small Picture frame
control the same size of the OLE frame control and filled with the image of a
small magnifier glass then I positioned it behind the OLE frame control.
Done! By clicking on any control but the magnifier glass nothing happens.
When the user clicks on the magnifier glass, code in the “Click†event will
retrieve all of the data for the selected record and use them to fill another
form where they can be edit by the user.
Maybe this can be of some help to someone.
Rocco
continuous form to be used to show all of the records filled in a table and
giving the possibility to the user to select each row and perform action on
the record (mine is retrieving all of the information from the record and use
them to fill another form where the data can be edited). This can be easily
accomplished through regular continuous form but I stated few requirements:
a) the form should be unbound and the data should be not editable;
b) I hate having that crappy effect of all the text selected when you click
on a textbox to make the form pointing to the chosen record.
The table I’m using to get the data has 13 fields, but I only need 5 of them
to get the data to be displayed in the continuous form. Thus I wrote the SQL
statement to arrange the recordset that will act as recordsource for the
form. Then I made the 5 text boxes I need enabled=false and locked=true, and
this will get rid of that awful effect of having all the text selected when
you click on the control, giving the user the idea he can actually edit the
values.
I bounded these 5 controls to the relative fields from the Form.recordset.
This will give me the desired design but… will also make the “click†event
for each of the control unusable: it doesn’t fire if the control is
enabled=false.
But the “click†event is what I want to use to “select†the record, because
is the more intuitive for this purpouse. I solved by adding on ole filed to
the table and leaving it blank (thus preserving the size of the database) and
changing the SQL statement to add it. Than I added an unbound ole frame
control to the form, right at the beginning of each row (record) and bounded
to this field from the recordsource. I made the background style and border
style for this control transparent. Last I added a small Picture frame
control the same size of the OLE frame control and filled with the image of a
small magnifier glass then I positioned it behind the OLE frame control.
Done! By clicking on any control but the magnifier glass nothing happens.
When the user clicks on the magnifier glass, code in the “Click†event will
retrieve all of the data for the selected record and use them to fill another
form where they can be edit by the user.
Maybe this can be of some help to someone.
Rocco