Solved

button in table on form

Posted on 2013-06-21
3
237 Views
Last Modified: 2013-06-30
hey guys,

i have a form and on it it has a table. this table contains all the steps in a workflow a staff has to do to finish a certain activity. i would like to have a command button in each row of the table so that when the staff clicks it, it will run code to complete that task.

how can i do so? or if this is not possible is there a work around? or if not possible still is there a different way? thanks guy!! = ))
0
Comment
Question by:developingprogrammer
3 Comments
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 150 total points
Comment Utility
When you say a "table", what exactly do you mean? You can't embed a table in a form, although you can build a datasheet form that looks somewhat like a table.

If you have a datasheet form, then you can't add buttons to that form. You'd have to change to a continuous form, and build that to look like a datasheet (and you can then also add your button). You might also be able to use a hyperlink field to do this, but that is troublesome (at best). You're much better off switching over to a continuous form and formatting it to look like you need.

Also - are these predefined tasks? That is, you have a set of 5 (or 10, or 100) tasks, and you have predefined actions which must be taken to complete that task? If you don't, then I'm not sure how you'd write code in advance that would complete the task.
0
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 350 total points
Comment Utility
Hi,

in one point I disagree with LSM Consulting: You can of course implement a table or a view directly into a form without creating a datasheet form, but I don't recommend to do so. That can be done by simply creating a subform and set the SourceObject property to the name of the table, that's all.

This is not recommended because you have no control over the table/view because there are no events like in a form. You can also not enable/disable a field or use Conditional Formatting and so on. So this method is only usable if you really only want to display some data without interaction by the user or if you want to display different views in one form (also only for displaying).

So the solution is to use a continous form either in datasheet view or normal continous form view. In the last case you have all formatting possibilities like adding a button and so on, in datasheet view you can only use a "fake" hyperlink: Simply display the text of a field underlined and in blue color so it looks like a hyperlink and then use the click event of the field to do something with the current line. This works in continous forms and datasheet view, but depending on the Access version you will not see the underlining and blue color in datasheet view.
Adding a button in a normal continous form view is no problem and you need not much code to make that work.

See the attachment demo database where I show all these methods.

Cheers,

Christian
ButtonTable.zip
0
 

Author Comment

by:developingprogrammer
Comment Utility
guys superb answers and thanks so much for the help!! let me implement this and then reply yall ok? thanks so much once again guys!! = ))
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now