473,700 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

continuous form buttons with different images (from table)

An Access 2000 question


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).

Here is my table that should create 4 buttons on the subform, when
filtering for process printStart.

btnId - Number - number of button on screen to iterate
btnProcess - Text(20) - Process, e.g. Print Finish, Screen, Die Cut
(some processes do not have filter buttons!)
btnImg - Text(20) - Name of Button Picture (normal status)
btnImg_Active - Text(20) - Name of Button Picture in "Selected" State
btnSound - Text(20) - reserved for future use
btnCaption - Text(50) - Caption of button (displayed in separate
label, because button will have Picture)
btnFilterMc - text(20) - For building a query filter on parent form
Selected - Yes/No - to make buttons behave like "radio buttons"

(beware line breaks)
btnId,btnProces s,btnImg,btnImg _Active,btnSoun d,btnCaption,bt nFilterMc,isSel ected
0,PrintStart,AL L.bmp,ALL_a.bmp ,,ALL,,No
1,PrintStart,im age1.bmp,image1 _a.bmp,,T3000A, T3000A,Yes
2,PrintStart,im age2.bmp,image2 _a.bmp,,T3000B, T3000B,No
3,PrintStart,im age3.bmp,image3 _a.bmp,,T3020,T 3020,No
4,PrintStart,im age4.bmp,image4 _a.bmp,,T4000,T 4000,No

Each button triggers a query filter for displaying data in a listbox
pertaining to a certain (Print Process) Machine => btnFilterMc. Each
button should be graphic style and have its own unique image, which
should be
if Me.Selected=No _
Button.Picture= Me.btnImg
if Me.Selected=Yes _
Button.Picture= Me.btnImg_Activ e
Is this possible?
Also a Label underneath the button should display btnCaption.

If this is possible I could create a generic form with different
(optional) filter buttons with uniqe images that would work like radio
buttons. Otherwise I would have to create 6 different forms (some of
them with some without buttons) and it would create a lot of work on
2nd and 3rd plant integation.

thanks in advance

Nov 13 '05 #1
5 5354
I have a bunch of screen shots here of continues forms, and you can see that
a lot of them have buttons with a image:


So, I assume (if you look at the above), you want each button to have a
different image. Nope, you can't do that, as those continues forms buttons
are the SAME copy. (you might get away using a fixed form on the left side
with 15 buttons, and then match up a continuous form on the right side with
room for 15 records. You would then "change" the buttons images on the left
side in code. However, scrolling would make this VERY hard to match the
records to the images.

So, at this point, I think you need to use the listview control...or even a
contorl like tlist7

(sone screen shots here:)

and more about the contorl here:

Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
Nov 13 '05 #2
Hi Axel

I think you CAN do this. I have written continuous subforms using a
Bound Object Frame. You create a table with an OLE Object field which
you use as the recordsource for the subform and then you bind the Bound
Object Frame to this field. You can put images into the table by
opening it in access and right-clicking the box for the field and
selecting Insert Object... I think you are limited though to using
bitmaps here.

In my app the user just clicks the Bound Object Frame which responds to
the click events like a button. However, you could put the Bound
Object Frame on top of a button object if you really wanted it to look
like an ordinary button. Or you could have 2 OLE Objects in your table
(I think this is closer to what you are after) and copy the selected
version of the bitmap into the bound-to field when the Bound Object
Frame is clicked.


Nov 13 '05 #3
thanks Albert for the reply.

scrolling is not a problem there will be max 6 buttons (probably only
5) on screen. The reason I wanted an array is that there are (about) 10
different screens with varying numbers of process steps (a few of these
have no filters, e.g. Ink so I need to hide all the buttons). I come
from a C++, VB background and do not like copy and paste coding, that's
why control arrays in VB were quite handy

Listview might be a solution as long as I can populate it with bitmaps
at runtime. TList is definitely overkill and the customer doesn't want
to use 3rd party controls.

I might stick with static buttons and make only used ones visible, then
use ADO to iterate my table and set

While Not rs.EOF
Select Case nLoop
case 1:
cmdFilter1.imag e=rs.Picture
lbLabel1.Captio n=rs.Caption
case 2:
cmdFilter2.imag e=rs.Picture
lbLabel2.Captio n=rs.Caption
End Select

clunky code but Access isn't C++ or VB, unfortunately. Maybe its
possible to access the control in a way like
Controls.button ("cmdFilter" & nLoop) that would make it easy to code -
any idea?

Nov 13 '05 #4
hmm, sounds probably more complicated than it is.

I only want to store the file name of the button image as text field
and the image should be loaded at run time, is that covered by what you
describe? The button doesn't have to look like a button because I can
always stick the "button" in the image to make it look like a button -
am I making sense?


thanks for you input

PS: Given a choice I would use much less form bound coding and do as
much as possible in code, it is so much less oblique. Especially when
using yummie classes. And you can actually debug it and source control
it an all these good things; no need to poke around in overbearing
forms and torturous object properties and unreadable query windows...

Nov 13 '05 #5
I might stick with static buttons and make only used ones visible, then
use ADO to iterate my table and set

clunky code but Access isn't C++ or VB, unfortunately. Maybe its
possible to access the control in a way like
Controls.button ("cmdFilter" & nLoop) that would make it easy to code -
any idea?

Remember, any collection in VB6, or ms-access can be ref by the keyid.
Collections are the "key" to un-locking ms-access..

if cmdFitler1 was the first contorl, then

me!cmdFilter1 =
me(0) = (controls is the default collection)
me.Contorls(0) =
me("cmdFilter1" ) =

Note the last one, and how string expression was used. This applies to forms
collections, reports collections, and in fact virtually any collection in
VB6 or access can be referenced by a string, or "index" value. Note that
ms-access shares the same compiler as VB6, just a different forms object
model without control arrays!).

So, if I had 10 controls on a form, (lets use a text box control), then to
fill all of them with the text "hi"

for i = 1 to 10
strC = "cmdFilter" & i
me(strC).Value = "hi"
next i

Note the use of .value (in ms-access .text property of a control has a
DIFFERENT meaning then vb6...so don't get bitten on that one!!).

You can thus use a string var to reference a form, forms controls, or even
fields in a reocrdset. This concept of referencing collections is universal
to all of VB6, or VBA (they are the same in this regards). (even a ADO
reocrdset works this way with fields collecitons). So, the only tough work
ahead here is to learn the collections in ms-access objects like forms etc.
(which by the way are far more complex then vb forms).

Good luck.....
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
Nov 13 '05 #6

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

Similar topics

by: Damian | last post by:
Hi. Is there a way to programatically populate a continuous form? I have an array of descriptions that I want to display in the continuous form and I have a textbox on the form called 'txtDescription' I can populate the text box using this code: Me.txtDescription.Value = myArray(1) Trouble is, I can't figure out how to get more than 1 row to display
by: laurenq uantrell | last post by:
I have read all the previous posts on this subject and just want to make sure I have exhausted all possibilities before trashing this concept... I have an Access (2K) database with a SQL Server backend. I have a table on SQL Server that has a column that is used to hold small icons with datatype image. This table links to others to form a recordsource that populates an Access continuous form that displays the icons in a bound object...
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. Tables: (abbreviated) TblDivision DivisionID
by: DFS | last post by:
I'm sure this has been discussed before, but I'm too tired to hunt for it. I have a survey table containing questions with different answer scales. Some are 1 to 5, others are A,B,C, etc. I show these answer scales in a listbox. When the scale type changes, the list items should change. Problem is, the bound continuous form shows for all questions only the scale for the first question - unless I click on a question with a different...
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of either an option button plus two text fields or a checkbox plus two text fields Am wanting to save the user entries into an underlying table. Tag property for each option button, check box or text field has the value of the key
by: Bill | last post by:
Problem: Combo box data disappears from view when a requery is done See "Background" below for details on tables, forms & controls On a form, I want to use the setting of bound combo box C1 to limit what is displayed in bound combo box C2. When I display Tbl-A records on a continuous form, and navigate away from record 1 to record 2, the previously entered data displayed in C2 for record 1 disappears from
by: Pablo | last post by:
I have a Continuous Form based on the following table: sku, description, categoryId, subCategoryId I restrict the initial dataset to include one value for categoryId, but it may include differing valuse for subCategoryId. The user needs to be able to modify either Category or SubCategory. I have placed two combo boxes on the form, they are query based and linked to the two Id columns. The cboCategory displays category names
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The form is based on a link table to sql server. Here is the code: Dim rst As DAO.Recordset Dim InventoryItem As String InventoryItem = "'" & "TextBoxValue" & "'"
by: ChipR | last post by:
I'm suddenly having a major problem trying to switch between rows in a continuous form in Access 2007. The form represents a timesheet and has a row for each activity that an employee may work on. There are 14 columns on the form for the days in the pay period, and each day is a text box, basically simulating a spreadsheet. So a row is a record in my source table. If my cursor is in day1, and I click another row, it moves the cursor to the...
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: 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,...
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: 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: 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: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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...

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.