i have a continuous form that i want a toggle button to display "on" or "off." everything i try changes every single caption on the continuous form--rather than the single row. here's what i have so far: - Private Sub Detail_Paint()
-
If OnOff.Value = True Then
-
OnOff.Caption = "On"
-
Else: OnOff.Caption = "Off"
-
End If
-
End Sub
it works, but every time the mouse moves over the button, the button flickers. this is not as clean as i would like it to be but if nothing else comes up, i suppose i can live with it.
7 7032 FishVal 2,653
Recognized Expert Specialist
Hi, there.
The problem is that the buttons in different rows are just one single control. You could not change an appearance of the button in <all rows.
A workaround here may be bound ToggleButton control, which certainly requires additional field in the linked table to be bound to.
Regards,
Fish
Hi, there.
The problem is that the buttons in different rows are just one single control. You could not change an appearance of the button in <all rows.
A workaround here may be bound ToggleButton control, which certainly requires additional field in the linked table to be bound to.
Regards,
Fish
i'm sorry, i forgot to mention that it was indeed bound. i think i'm going to have to settle with the "flickering " for now. one small problem with this however, is when i delete a record i get runtime error 2424. "the expression you entered has a field, control, or property name that access cannot find." if i click end twice (since the error pops up twice), it works fine. so how do i bypass this error using the code i already have?
- If DataErr = 2424 Then
-
Response = acDataErrContinue
-
End If
i've got this much... where do i place the code??
- If DataErr = 2424 Then
-
Response = acDataErrContinue
-
End If
i've got this much... where do i place the code??
this is my final code. i realize i may not have been clear about my problem up above. the code i am listing below is the only solution i have to the problem of every single caption changing whenever one is changed in a continuous form. everything works great now except for a flicker whenever the mouse is moved over the button. - Private Sub Detail_Paint()
-
-
On Error GoTo PROC_ERR
-
If Not IsNull(Apply1.Value) Then
-
If OnOff.Value = True Then
-
OnOff.Caption = "On"
-
Me.Dirty = False
-
Else: OnOff.Caption = "Off"
-
End If
-
Else: Exit Sub
-
End If
-
PROC_ERR:
-
On Error Resume Next
-
End Sub
can anyone help with the flicker problem?
minor correction to the above code: - Private Sub Detail_Paint()
-
On Error GoTo PROC_ERR
-
If Not IsNull(OnOff.Value) Then
-
If OnOff.Value = True Then
-
OnOff.Caption = "On"
-
Me.Dirty = False
-
Else: OnOff.Caption = "Off"
-
End If
-
Else: Exit Sub
-
End If
-
PROC_ERR:
-
On Error Resume Next
-
End Sub
FishVal 2,653
Recognized Expert Specialist
Hi, there.
You use Detail_Paint event which I could not find in Access 2003.
This makes me think you are using Access 2007.
If so, then you may take advantage of bound Image control to mimick toggle button.
In form RowSource: -
SELECT ..., iif(OnOff, "X:\...\OnButtonFace.bmp", "X:\...\OffButtonFace.bmp") AS txtPathToButtonFace FROM ....
Image control is bound to [txtPathToButton Face].
Image_Click event handler inverts [OnOff].Value.
Button faces may be grabbed directly from screen. ))
Unfortunately (or maybe fortunately :)) I have no Access 2007. If you does and want to give it a try, then code debugging is all upon you.
Regards,
Fish
Hi, there.
You use Detail_Paint event which I could not find in Access 2003.
This makes me think you are using Access 2007.
If so, then you may take advantage of bound Image control to mimick toggle button.
In form RowSource: -
SELECT ..., iif(OnOff, "X:\...\OnButtonFace.bmp", "X:\...\OffButtonFace.bmp") AS txtPathToButtonFace FROM ....
Image control is bound to [txtPathToButton Face].
Image_Click event handler inverts [OnOff].Value.
Button faces may be grabbed directly from screen. ))
Unfortunately (or maybe fortunately :)) I have no Access 2007. If you does and want to give it a try, then code debugging is all upon you.
Regards,
Fish
thanks for your advice. yes, i am running access 2007 so i will give your suggestion a go and post back with my results.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David |
last post by:
Hi,
I need a button shown for each record (cont. form) with specific
captions on each.
I have a notes form for each record. When a user presses the button
they can read the notes. I want to display a caption on the button to
state either "Order Notes" or "READ NOTES".
I placed a label over the button, and depending if the notes field is
|
by: MLH |
last post by:
Why is that?
If I choose the tiny check boxes which are hard to
hit with a mouse, it works fine. But option buttions,
shich can be sized big enough for people with limited
sight and dexterity to hit - they don't work at all.
Its true. I created 'em with the built-in wizard furnished
with Access 97 but they do not work. I put 12 of 'em
in the group, labeled the months of the year and giving
|
by: Neil Coleclough |
last post by:
I am constructing a database to process product returns for my Company.
I have a number of toggle buttons to identify the stage to which each
return has been processed. For example, clicking the first button
confirms that the goods are now in our building awaiting initial
processing. This button then fires off an email to our warehouse staff
alerting them to the fact. I want to restrict these buttons to single
use, so that once the email...
|
by: Wonder |
last post by:
How can I create or use the msgobx to show a message without a default
button. The user has explicity to click on the button, so the msgbox closes
it.
Thanks,
|
by: John Smith |
last post by:
How can I use a transparent command button to change a checkbox?
I have my records set up in a continuous form and I want theuser to be able
to click on the record and have this toggle the "Print" checkbox. the
command button would be set up as transparent and cover the entire record.
| |
by: afr0ninja |
last post by:
Hello! I'm currently working on a form that has several input fields
and a subform. What I'm trying to accomplish is that when I first open
the form I'd like to have the input fields displayed only. The fields
are about 3" wide. Then I'd like to have a command button that when
pushed it would expand the form to about 9" displaying the subform
along with the input fields. The command button could then be pressed
again to shrink the...
|
by: Jeffrey Christiansen |
last post by:
I wanted to add a toggle button to a VB2005 form to be used for a
simple Windows Application (i.e. compiled to a "*.exe"), so I added
the ActiveX Microsoft Forms Object toggle button, however I can't get
this button does work properly. The documentation I found in the
FM20.CHM files says the button state can be determined from its
"Value" property, but the property list shown in VB2005 does not have
a "Value" property. How is the button...
|
by: dkohel |
last post by:
I have a form that returns 100 items. All of the items have have a
different value in their Category field.
EXAMPLE:
----------------
A
B
C
How can I change the value of the caption in the field label on the
|
by: 6afraidbecause789 |
last post by:
Hi - Has anyone ever used toggle buttons to select items in a
listbox? I'd like to put about 24 toggle buttons on an unbound form
that select or deselect items in a multiple select listbox. I've come
across a way to set the listbox value to only 1 at a time, but need
multiple toggle buttons to be on their corresponding listbox item
values to be selected. Thanks!
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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...
|
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...
|
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...
|
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();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |