473,545 Members | 2,567 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

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

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

Design
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"
Data

(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
Axel

Nov 13 '05 #1
5 5348
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:

http://www.members.shaw.ca/AlbertKal...icles/Grid.htm

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:)
http://www.bennet-tec.com/btproducts...creenShots.htm

and more about the contorl here:

http://www.bennet-tec.com/btproducts/tlist/tlist.htm
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
http://www.members.shaw.ca/AlbertKallal
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.

James

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

nLoop=0
While Not rs.EOF
nLoop=nLoop+1
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
rs.MoveNext
Wend

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?
thanks
Axel

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
Axel

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
http://www.members.shaw.ca/AlbertKallal
Nov 13 '05 #6

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

Similar topics

3
6294
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...
3
3021
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...
4
3158
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
10
3401
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...
20
10790
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...
1
4855
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,...
2
2637
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...
13
3433
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 = "'" &...
2
3135
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...
0
7490
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...
0
7682
Oralloy
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. ...
0
7935
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...
0
6009
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...
1
5351
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...
0
5069
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...
0
3479
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...
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
734
bsmnconsultancy
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...

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.