Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable 1st Row in Subform Datasheet 1

Status
Not open for further replies.

v5652

Programmer
Mar 19, 2008
76
IN
hello friends,

Is it possible to disable 1st row of datasheet like MSFlexGrid?
can anybody has the solution for it?
thanks
 
How are ya v5652 . . .

I've never used [blue]MSFlexGrid[/blue] and unless someone comes along who has ... this thread is certain to fall thru the cracks.

Could you explain what happens in [blue]MSFlexGrid[/blue] when you disable the 1st row?

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
hi TheAceMan1,
thanks for your reply.

I have never used MSFlexgrid in Access 2007. but I have such requirement from one of my client that the 1st row of datasheet should be disabled like column header.

The grid display should be like below, (all columns are dynamic)
(user can enter following values.)
e.g. Appraisers = [ 3]
Parts = [ 3]
Entries = [10]
-----------------------|------------------|------------------|
SrNo| Appr1 | Appr1 | Appr1 |
-----------------------|------------------|------------------|
| 1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 |
-----------------------|------------------|------------------|
1 | | | |
2 | | | |
3 | | | |
4 | | | |
. | | | |
. | | | |
. | | | |
10 | | | |
-----------------------|------------------|------------------|

I thinks u may get what I want.

thanks.
 
I am still not sure that I understand exactly what you are asking, but if you need a grid because the row data in the top row comes from a different source than the other rows there are 3 ways to do it.
Use a flexgrid in Access, but distribution of this is difficult and it is finicky with different versions.
Use an unbound form. This can handle displaying a known amount of rows, but difficult if the amount of rows is always growing and the number of rows and columns is large.
Use a "grid table". This is a table used for presentation and entry only. When you open the form you load the table from other normalized tables and when you close the form you write from this table back to the normalized tables. This technique has the advantage of handling lots of rows and unknown number of rows.
 
You can see an explanation of the 3rd method here.

thread702-1649247
 
thanks MajP,

sorry i think my post is little bit confusing. Ok forget about the 1st row disable requirement.

I have seen the thread and it is quite useful for my requirement.
but my problem is that my Fields are Dynamic, they are not fixed as I have seen in your thread example (e.g. Day-1 to day-7).

The fields depends on user's Inputs.
Means, if the user has given,
"Appraisers = 3 and Parts = 3"
then i have to add 9 Fields thru code in a temp table.
and every time the user's input will be vary.
but how should i do it i couldn't get it.
so can you tell me that how can I do this?
Attached screen shot sample what i want exactly to do in Access.
 
 http://www.mediafire.com/i/?j307x6c111dm8wm
How I would do this would depend on the specific requirements
1) Do the columns have to be resizeable (i.e. datasheet)?
2) Can it be a continous form?
3) Are the amount of appraisers limited? (never more than X)?
4) Are the amount of items limited?
5) can you use a flexgrid? Or you only want to mimic a flexgrid?
6) Are the number of entries known ahead of time or is that continous.

This "grid table" would work to do what you are asking, but you may want to think of a more standard approach using the native controls.

If you want to use this "grid table" approach. It appears to me that you would simply build the table based on the number of appraisers and readings selected and the number of entries.

User enters number of appraisers and number of readings. Create a table with Appraisers * readings fields. Plust another field possibly for Entry number (which you show). If the number of entries is known and set then add a record for each entry.

Adding controls dynamically to a form is doable in access, but is not a very stable approach and usually will cause a crash in the database after time. However having a whole bunch of hidden controls and then selecting x of these controls, moving, positioning, and setting properties is very doable. If a continous form is useable for use then I would show and assign labels for all the Appraiser and readings. The grid would only hold the reading values. Because basically your first two rows are labels and not data

Writing from the grid would require simple math.
column 5 (assuming 3 appraisers and 3 readings) is the 2nd appraiser 2nd reading. The column in the grid is a field. you can use the fields collection to determine which field.
 
Thanks for your support.
I have done it on my own way.
For a trial I have created a temp table with 20 fields naming Reading1....Reading20.
(Used Hide/Unhide method)
e.g.
Appraisers=3
Parts=3
3*3=9
then I have shown only 9 fields and others are hidden.
I think this may get solved my problem.
Can you please tell that what i have done is the right approach to do this?
any suggestions from your side?
 
If it works, then that is all that matters. Any solution requires a work around. This has been one of my big complaints with Access they do not provide a native unbound grid control. You can use a flexgrid in Access, but it is poorly supported and distributing it is a pain.

This is why I was asking about if you had known limits to the number of appraisers/parts. If it is limited to 20 fields than this seems like a viable solution. You can show and hide columns in a datasheet very easily. Your basically faking an unbound grid control with a table. As I demonstrated in the thread I reference, it works fine. This post might help in manipulating the datasheet.

The only question I really have is before going down this path is: does the user interface really have to be like this? You coming up with a workaround that is not really meant to be done, so obviously a traditional "main form - sub form" solution would be easier. However, if it really is best to do it this way then you should be fine. I have used this concept in many places with no problems.

Do you have questions on loading the grid and writing from it?
 
Actually the client has want some easy data entry option for this hence he insisted me to do this type of entry form. already i have suggested him the "mainform - subform" option but it was uneasy for him to do the entry.
and regarding limits to the number of appraisers/parts, it may be more than 20 fields but i have added 20 fields just for testing purpose.
Currently I haven't any problem with grid but i have to test it with some more trials.
if any questions i will write to you.
and very very thanks to you for your calm & useful support.
 
Do you not want to use a flexgrid? It is definately a very viable solution if you can control the distribution and versioning.
 
I didn't used it before this.
do you have any sample database in which Flexgrid is used?
if you have, can you please send it to me on my email?
my email id is vsoftcomputers.karad@gmail.com
 
Thanks MajP,
It's a very good demo of using Flexgrid in Access.
I must use this in my applications.

thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top