How to make many textbox or many command button in the same time ? (1 Viewer)

MichealDon

Registered User.
Local time
Today, 13:52
Joined
Nov 25, 2017
Messages
29
Hi everybody,
I have a query with some fields (ID, Name, Position, Workcontent, Confirmed). The query have more than four dozen of records.
Now I want to make number of text-boxes and number of command buttons which these will be equal to number of records. Because the number of them too many, so the making a textbox or making a button and the way "Copy and Paste" is not good way for creating like this. So I need to find another way to make them more easily.
is there any solution for this making ?
Many thank for helping.
MichealDon
 

June7

AWF VIP
Local time
Today, 12:52
Joined
Mar 9, 2014
Messages
5,466
Not making sense. Set form RecordSource to the table or query. Create one textbox for each field. Set textbox ControlSource. The textboxes will repeat for each record. One comnand button will also repeat.
 

MichealDon

Registered User.
Local time
Today, 13:52
Joined
Nov 25, 2017
Messages
29
Not making sense. Set form RecordSource to the table or query. Create one textbox for each field. Set textbox ControlSource. The textboxes will repeat for each record. One comnand button will also repeat.

Dear June7,
Thank you for your reply.
I mean that on the form a want to create 40 textboxes for only one field in the same time. (such as with ID field, 40 created texboxes will be gotten value from every record of the field ID)
For example : With Field ID in query with Value ID.01, ID.02, ...., ID.39, ID.40.
So textboxes created in the form must be txt_ID.01, txt_ID.02, ...., txt_ID.39, txt_ID.40 relatively.
And the number of buttons in the form will be same. (btn_ID.01, btn_ID.02, ....., btn_ID.39, btn_ID.40)
Thank you again.
MichealDon
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:52
Joined
Sep 21, 2011
Messages
14,238
What happens when you have 80 records, 120, 160 etc?

I cannot envisage this be a good idea at all?

Why not say in English what you are trying to do and someone with a lot of experience will likely offer a better way.

It could be done, but seriously and not trying to offend you, but with your current Access skills, it would be very hard to do.?
 

mike60smart

Registered User.
Local time
Today, 21:52
Joined
Aug 6, 2017
Messages
1,904
Hi

Are you saying that you want a way of going to a specific record using Command Buttons?

Can you upload a zipped copy of the Db sowe can see your table structure??
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 06:52
Joined
Jan 20, 2009
Messages
12,851
Now I want to make number of text-boxes and number of command buttons which these will be equal to number of records.

What you are proposing is completely impractical. Use Continuous Forms.
 

missinglinq

AWF VIP
Local time
Today, 16:52
Joined
Jun 20, 2003
Messages
6,423
As June7 said...Create one textbox for each field! One Textbox for ID, One Textbox for Name, One Textbox for Position, and so forth.

Access will repeat these Textboxes for each Record...whether it be 40 Records, 400 Records. or 4000 Records!

Linq ;0)>
 

James Dickinson

PigeonPie
Local time
Tomorrow, 08:52
Joined
May 10, 2018
Messages
43
there is a limit of 754 controls that can exist on any singular form. Access will cry if you do any more. I think the answer lies in correctly defining what it is that you really want to see. If you want to see each record in the table then simply drag the table onto your form and have an embeded datasheet. If you want to play with the layout of your data then I suggest creating a Continuous Form such as Galaxiom suggested.
 

Attachments

  • ContinuousForm.png
    ContinuousForm.png
    35.5 KB · Views: 61

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:52
Joined
Jul 9, 2003
Messages
16,273
there is a limit of 754 controls that can exist on any singular form.

You can circumvent this limitation by placing subforms on your main form.

It is unlikely that a form with 700 odd controls on it would be useful / useable...

A better approach would be pagination, either your own design, or taking advantage of the tab control.

For example, a set of tabs with a subform on each. Or better, each tab displaying the same subform, but have the subform loaded with different data.

See my "Time Management Matrix" example here:-

http://www.niftyaccess.com/subform-time-management-matrix-example/

Sent from my SM-G925F using Tapatalk
 

jdraw

Super Moderator
Staff member
Local time
Today, 16:52
Joined
Jan 23, 2006
Messages
15,379
@MichealDon,

Can you tell us in plain English what you are trying to accomplish?

This is not a typical request/database approach:
Now I want to make number of text-boxes and number of command buttons which these will be equal to number of records.
 

MichealDon

Registered User.
Local time
Today, 13:52
Joined
Nov 25, 2017
Messages
29
Dear All,
First, I want to thank all of you for your opinion about my threat.
My database have more than 20 queries, number records in query are not same. So every Single Form in the data have many textboxes. Depend in the number of records in the query, these textbox will be gotten value from records of one field. Just only a form, must create 40 text-boxes and command buttons approximately. So it need spend more time to do.
I am looking for a way to get more easily. But I do not know whether there is a way to make.
Attached picture is illustrated the single form with layout spreading from left to right.
This from is described work content for testing something (Name : Test A***) in the query source.
+ Textbox : The Name of Test (ie. Test A001, Test A002,... gotten value from field WorkContent)
+ Command button : Confirmation of UserLogin to implement the Test.
+ Textbox : The identidied UserName log in with active status. ( ie. ID_E001, ID_E005, ID_E007, ...)
I will upload the Bd later.
Thank you very much.
MichealDon.
[/IMG]
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:52
Joined
Jul 9, 2003
Messages
16,273
The problem is you are trying to do something out of the ordinary.

Now don't get me wrong, I applaud anyone who comes up with a new idea and implements it nicely.

However I'm reasonably sure that what do you want to achieve could be done in a different way.

The problem is it's hard to know how to advise you because you don't appear to be listening to the comments already made.

I have seen many people propose various ideas for presenting and handling the data which fall outside of the norm. Generally you discover that if the data was formatted differently in the tables, or possibly the data was spread amongst different tables in different ways then the results can be achieved using the normal abilities of MS Access.

However after many answers received and requests for clarification you don't really seem to be saying anything different than what you said in your first post.

I can't see as there is any way to make any progress.

Sent from my SM-G925F using Tapatalk
 

jdraw

Super Moderator
Staff member
Local time
Today, 16:52
Joined
Jan 23, 2006
Messages
15,379
Tony,

Well said. I agree totally.

MichealDon,

To get meaningful answers/assistance, you'll have to supply a description of what you are trying to accomplish in terms readers can understand.

Good luck.
 

jleach

Registered User.
Local time
Today, 16:52
Joined
Jan 4, 2012
Messages
308
I don't think it's entirely farfetched to want to show data in a grid format like that. Access doesn't make it easy to do so, though.

The problem with this situation (normalization/best practice issues aside) is that it's not easy to create controls on the fly. In fact, if you plan to distribute as a *.de file, you simply aren't allowed to. This leaves options of:

a) use a UserForm from the MSO library, where you can create controls on the fly (this is how the All-VBA treeview was done). This is not usually desirable due to the added dependencies and difficulty binding/interfacing with native Access behaviors. Or:

b) create a whole boatload of controls (which serves as a max amount also), have them hidden by default, and dynamically bind, arrange and set visibility as required. This is a viable option if you know you'll never have more than X number of controls (and if X is a reasonable number), but takes a lot of programming. Or:

c) create a single "row" as a continuous form, with as many "columns" as you'll need displayed. Create a special query that forms the data as required into the number of "columns" you have, repeated as required. This is often preferred as you can be truly dynamic to show hundreds or thousands of rows, but is the most difficult to set up. Such queries are tricky, and formatting of the last few controls can be difficult as well (for example, if you have 5 "columns" per row, and 48 records, the last row shows 3 records, so you need to "hide" the last two column controls without interfering with the rest of the rows: this can usually be done via conditional formatting and an overlay, but isn't always easy to do).

At UtterAccess, Peter Hibbs has a nice Calendar demo which uses the "C" approach, IIRC. Not sure if there's something similar in the code archive here (one of the more-regulars may know).

If we had the equivalent of a WPF StackPanel, this would be simple! In any case, none of these really fall into beginner categories: it's either non-seasoned expert mode ("oh cool, a new challenge") or seasoned expert mode ("wtf, do I really have to waste time with this bs? <muttering about bad clients and ridiculous requests>")

Edit: I suppose also you could embed a web-browser control and use a local html with masonry-style JS library to lay out some components to give the effect of a stackpanel and use the browser control DOM API to pass the data into the local document and render via JS, but that's really stretching the bounds of practicality pretty far (feasible, yes, but not practical except at great need)...
 
Last edited:

Mark_

Longboard on the internet
Local time
Today, 13:52
Joined
Sep 12, 2017
Messages
2,111
@ OP,

Something like the attached?
 

Attachments

  • CF5.accdb
    864 KB · Views: 71

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:52
Joined
Jul 9, 2003
Messages
16,273
Just to give you an idea of what can be done with subforms, have a look at these two videos:-

https://www.youtube.com/playlist?list=PLhf4YcS5AjdryDHwkioNLF6LJFE2flnKv

where I started to develop an example of a car hire database.

As you can see each row is a subform. What's not obvious is it's the same subform, that is; "each row" is the same subform!

This means you can have 10 or 20 Rows, or more even, but you only have to code ONE Subform because it's duplicated, used many times! Think how easy that makes it to use and set up, once you understand the principle behind it!

Sent from my SM-G925F using Tapatalk
 

MichealDon

Registered User.
Local time
Today, 13:52
Joined
Nov 25, 2017
Messages
29
Just to give you an idea of what can be done with subforms, have a look at these two videos:-

where I started to develop an example of a car hire database.

As you can see each row is a subform. What's not obvious is it's the same subform, that is; "each row" is the same subform!

This means you can have 10 or 20 Rows, or more even, but you only have to code ONE Subform because it's duplicated, used many times! Think how easy that makes it to use and set up, once you understand the principle behind it!

Sent from my SM-G925F using Tapatalk

Thank you for video and advise me.
Some in your database is similar as what I mean, I will design form from subform method like this.
Best Regards,
MichealDon
 

Users who are viewing this thread

Top Bottom