473,804 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Buttons for Each Row in a form

Hi all ,

I'd appreciate anyone insight on this

I have created a form that fetched rows from a query. On each row I
have added buttons to execute command for that relevant row only. The
Form displays all rows fetched in tabular format.

Now one of the data fetched is a Yes/No Value , When it is true it
should hide some of the buttons and make some visible.

I have written that routine but I dont know on which event shall i
place it at. When I put it at (form on load) it says object undefined.
?! any clue

Private Sub is_approvedBox_ (### What Event ###)(Cancel As Integer)

If (is_approvedBox .Value = -1) Then
QualifyLeaveCmd .Visible = False
DeleteLeaveCmd. Visible = False
PrintReport.Vis ible = False
EditLeaveCmd.Vi sible = True

Else
PrintReport.Vis ible = True
QualifyLeaveCmd .Visible = True
DeleteLeaveCmd. Visible = True
EditLeaveCmd.Vi sible = False
End If
End Sub
Will I also need to pass a variable to the button when i click it
stating which row it belongs to ?
I'm confused.
Thanks Again

Regards

Alya

Nov 28 '06 #1
2 6720
In a continuous form, you cannot hide the buttons on some rows but not on
others.

You may be able to simulate this if you used an unbound text box instead of
a command button. Set its Control Source to the text you want to appear as
the "label" on the button, e.g.:
="Click Me!"

You can then use Conditional Formatting (CF) of the text box to simulate a
disabled look, by changing the ForeColor to a grey and changing the
BackColor. The CF does work on different rows.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<al******@gmail .comwrote in message
news:11******** **************@ l39g2000cwd.goo glegroups.com.. .
Hi all ,

I'd appreciate anyone insight on this

I have created a form that fetched rows from a query. On each row I
have added buttons to execute command for that relevant row only. The
Form displays all rows fetched in tabular format.

Now one of the data fetched is a Yes/No Value , When it is true it
should hide some of the buttons and make some visible.

I have written that routine but I dont know on which event shall i
place it at. When I put it at (form on load) it says object undefined.
?! any clue

Private Sub is_approvedBox_ (### What Event ###)(Cancel As Integer)

If (is_approvedBox .Value = -1) Then
QualifyLeaveCmd .Visible = False
DeleteLeaveCmd. Visible = False
PrintReport.Vis ible = False
EditLeaveCmd.Vi sible = True

Else
PrintReport.Vis ible = True
QualifyLeaveCmd .Visible = True
DeleteLeaveCmd. Visible = True
EditLeaveCmd.Vi sible = False
End If
End Sub
Will I also need to pass a variable to the button when i click it
stating which row it belongs to ?
I'm confused.
Thanks Again

Regards

Alya

Nov 28 '06 #2
Hi there

A slightly left field take on this! but...

If you put your buttons elsewhere on the form rather than within the
record row itself and given that the action behind the button can
easily be made to apply only to the currently selected record then you
can switch the buttons on and off depending on the values in the
current record using the onOpen and onCurrent events to your hearts
content! I find it's rare that you need to have the buttons actually
inside the row itself especially when the user usually needs to select
a row anyway!

Purpleflash

al******@gmail. com wrote:
Hi all ,

I'd appreciate anyone insight on this

I have created a form that fetched rows from a query. On each row I
have added buttons to execute command for that relevant row only. The
Form displays all rows fetched in tabular format.

Now one of the data fetched is a Yes/No Value , When it is true it
should hide some of the buttons and make some visible.

I have written that routine but I dont know on which event shall i
place it at. When I put it at (form on load) it says object undefined.
?! any clue

Private Sub is_approvedBox_ (### What Event ###)(Cancel As Integer)

If (is_approvedBox .Value = -1) Then
QualifyLeaveCmd .Visible = False
DeleteLeaveCmd. Visible = False
PrintReport.Vis ible = False
EditLeaveCmd.Vi sible = True

Else
PrintReport.Vis ible = True
QualifyLeaveCmd .Visible = True
DeleteLeaveCmd. Visible = True
EditLeaveCmd.Vi sible = False
End If
End Sub
Will I also need to pass a variable to the button when i click it
stating which row it belongs to ?
I'm confused.
Thanks Again

Regards

Alya
Nov 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
6631
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
2
3156
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as they want. If they need to add more, they click an "add name" button and the javascript inserts another row of input boxes. Each row should have two radio buttons to indicate sex (M F). When you have multiple text input boxes with the same...
6
3441
by: MX1 | last post by:
Hi, I've created a series of navigation buttons to be used as a standard across many forms in an Access DB. Does anyone know an easy way to cut and paste these navigation buttons into each new form I create. Re-creating them is VERY Painful and regular cut and paste doesn't work. I've read something about making a standard module for each button but I don't know how to assign that to the new buttons on each form. Help.... :(
5
5060
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main form record. In each page of the tab control, there are three buttons: Add, Update, Delete. Any of these buttons will open another, smaller form to add, update or delete the related data record. Originally, I had placed the smaller form such...
5
5360
by: Axel | last post by:
An Access 2000 question Hi is is possible to have (as a subform) a continous form with 0..n buttons which have different images in each row. (Personally I would have preferred a button array and assign images in code, much easier with a class module - but unfortunately Access does not support control arrays).
2
11987
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put them each in a GroupBox. All the examples I saw from the books or from the web show me how to add static radio buttons at design, or dynamically at run time but with fixed radio buttons (like from an array). I need to create radio buttons based...
5
3573
by: Jan Smith | last post by:
I have a C# project that has a tab control with four tab pages. On each tab page is a set of three radio buttons (named radioButton1 through radioButton12). I would like to loop through the radio buttons and set their state without having to form the complete name of each one, something like this: public static void SetButtonState(Form frm, int ButtonCount) {
2
4912
by: ghadley_00 | last post by:
Hi, I have a database with a main table and a lookup table of customers, and reports for each of the customers listing each transaction they have listed. I have a form that has buttons for each of the reports that is written by hand. At present the number of customers can be altered manually, but that
5
2460
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has made the postback request.???" for e.g. I have a webpage default.aspx. I place TWO or more server buttons on it. Create server-side event handlers for each of the buttons.
0
8778
Denburt
by: Denburt | last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set up with this code and the way I set it up the first button is my search toggle button no submenu (this prevents a submenu from displaying when the form is first opened) TabIndex set to 0 (I like using the keyboard) the second toggle button is called...
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10070
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.