473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to create Button in access form from VBA

222 100+
Dear expert;

using access 2003 .

I have a table name "tables" that contains "tableid" & "tabledesc"

The idea is to design a form that contains for each record in "tables-->tableid" a button and each time user add a new record in tableid a new button will be created.

I was thinking to add the button through VBA on form open..

Any idea about that. ?

Thank you in advance;

WASSIM S DACCACHE;
May 19 '08 #1
5 4297
janders468
112 Expert 100+
It sounds like what you want to do is make a continuous form. You can use the form wizard to do this or you can setthis from the properties of the form. Set the recordsource of your form to the table and drag the relevant fields into the detail section of the form, place a button in the detail section of the form and you will have a button for every record.
May 19 '08 #2
wassimdaccache
222 100+
It sounds like what you want to do is make a continuous form. You can use the form wizard to do this or you can setthis from the properties of the form. Set the recordsource of your form to the table and drag the relevant fields into the detail section of the form, place a button in the detail section of the form and you will have a button for every record.
Man actually what I need is this form attached.

and they asked me to do it each 5 records related to the tableid on a single line or next each other
Attached Files
File Type: zip form.zip (53.9 KB, 306 views)
May 20 '08 #3
janders468
112 Expert 100+
I'm a little confused by your request, do you want to be able to select one of the buttons and see all the related table_id records along with a button for each?
May 20 '08 #4
wassimdaccache
222 100+
I'm a little confused by your request, do you want to be able to select one of the buttons and see all the related table_id records along with a button for each?
Thank you for your quick reply,

Ok let me expand what I am really thinking about.

I am trying to design a database for a restaurant. My boss asked to have a main form contains the number of table in restaurant. it means records "table_id".

The problem is--> he needs to group every 5 buttons in a single line. When I tried to make a continuous form all records was expanded in vertical way.

Is there any method in access to group a continuous form "ex: 5 records" (each line?
if not what I was thinking about is to have a module that count me the record on table and create buttons from VBA...

Please suggests to proceed.

BEST REGARDS;

WASSIM S DACCACHE
May 21 '08 #5
janders468
112 Expert 100+
My assumptions about what you want are:
1. You have a table with all of the tables (the real kind that people eat at) which each have a table_id.
2. You want to be able to group these table_ids into groups of five and have a button that corresponds to each table within the group.
3. When you press that button something relevant to the corresponding table happens.

If I were you, what I would do, is associate a group field within in the table of tables. For instance every table in group1 should have a corresponding value in the group field of 'group1' so:

Table_id | Group
1 Group1
2 Group1
3 Group1
4 Group1
5 Group1
6 Group2
And so forth.

I would use a continuous form with this table as the rowsource.
I would then populate a control with the distinct values of this table (I usually use comboboxes for this purpose but that's just my preference) so the row source for this control would be:
SELECT DISTINCT Group FROM tblTables (whatever your table is called)
When the user changes the value in this combox set the form's filter to whatever is in the combobox. I am shying away from telling you to add button via vba (i'm not sure if this is possible in access forms I know it is in forms 2.0 but not sure about access) but it is also a nightmare to keep up with all that overhead when it sounds like most of the functionality you need is already built into access.
Let me know if you have questions I'd be glad to help.
May 21 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tom Cusick | last post by:
We have a Job Shop database. When I get an order in I put all the line item information into the database. Some orders have multiple lines and most of the information is the same. (eg. Customer...
1
by: Dave | last post by:
I have a form which is based on a table (a) with over 6000 records.I have a button on this form which will open another form with related data from another table (b). What I want to do is open the...
3
by: Nigel C | last post by:
My problem is best explained by way of tables and examples... I am using Access 2000 (in case this is relevant) and I have a table with the following fields... Field names ------------ Code ...
6
by: Frank Wilson | last post by:
Tom, It sounds to me like ASP, not ASP.NET is handling the request for WebForm1.aspx. This is most likely an IIS config issue that may have been caused by order of installation or...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
1
by: regelcom | last post by:
My son is trying to create an about form button for a form he has already created. Any help would be great. Thanks
4
by: marek zegarek | last post by:
Hello! I have strange and simple problem.... I am starting developer. I need to create webform, that will insert my data into SQL 2005 database. My idea is to make something like MS Access...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
7
by: Edwin Martinez | last post by:
Hello I have a parent form but I want to create 4 forms that will be shown in a area inside the parent form when I click to buttons. +----------------------------+ | Parent Form ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.