473,378 Members | 1,504 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,378 software developers and data experts.

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.Visible = False
EditLeaveCmd.Visible = True

Else
PrintReport.Visible = True
QualifyLeaveCmd.Visible = True
DeleteLeaveCmd.Visible = True
EditLeaveCmd.Visible = 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 6631
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.googlegr oups.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.Visible = False
EditLeaveCmd.Visible = True

Else
PrintReport.Visible = True
QualifyLeaveCmd.Visible = True
DeleteLeaveCmd.Visible = True
EditLeaveCmd.Visible = 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.Visible = False
EditLeaveCmd.Visible = True

Else
PrintReport.Visible = True
QualifyLeaveCmd.Visible = True
DeleteLeaveCmd.Visible = True
EditLeaveCmd.Visible = 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
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
2
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...
6
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...
5
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...
5
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...
2
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...
5
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...
2
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...
5
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...
0
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.