Re: multiple subform images per main search form record

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello, Crystal...it's me again.

Thanks for pointing me to the links to the tutorial and to the report code.
I have read them both...great info that I needed to know (lots of stuff that
you miss when you learn Access just by using it). I found a couple of VBA
online primers that I've been looking at today, as I am in way over my head
at this point.

I am ashamed to ask for further instruction, but the more I read, the more I
confuse myself. I'm still trying to make the double-click event of the Image
controls on my form enlarge the images. You've explained how it should be
done, but you were right, it does sound like Greek to me.

I have added the textbox controls ImageID1 through ImageID5 on the main
form...but I don't have a clue what to do with them. I started out just
trying to use the 'ShowImages' function to also fill these ImageID controls,
but I am very confused and need your direction, please.

Hopelessly,

Carol

"strive4peace" wrote:

hi Carol,

"Is it possible to add something to this form to selectively enlarge
and/or print the images returned on the form? "

this is 1a2-part answer

1. too see enarged images on the screen, you can use a double-click event

if you process a double-click event for the images that are rendered on
the form, you need to make another set of 5 controls: ImageID1...
ImageID5 (they do not have to be visible) and write the image IDs --
then you can test right(me.activecontrol.name,1) to get the image number
and use me("ImageID" & ImageNumber) to refer to the respective ImageID
control
(ok, I know you are saying this sounds like Greek -- there is a lot
written in this paragraph -- read it a few times, it will start to make
better sense)

In the subform itself, you can process a double-click event on each
control to open another form. You can use the Where Clause of the
Openform action to limit the record.

syntax:
doCmd.OpenForm FormName, View, FilterName, WhereCondition, DataMode,
WindowMode, OpenArgs

for instance:
docmd.OpenForm "frmBigImage" _
, ,,"ImageID=" & me.ImageID_controlname,,acDialog

acDialog means that the popup form needs to be closed before you can
click on any other form

~~

the pop-up form would be based on your Images table and be a single-form
view showing an enlarged image.

some form properties you might want to specify on the popup form would be:

AllowEdits --> No
AllowAdditions --> No
AllowDeletions --> No

PopUp --> Yes
Modal --> Yes

2. for printing a report with the image ... make a report that shows the
enlarged image and filter it analgous to how you filter the popup form

doCmd.OpenReport ReportName, View, FilterName, WhereCondition,
WindowMode, OpenArgs

ie:
doCmd.OpenReport "rptBigImage", acViewPreview, , _
"ImageID=" & me.ImageID_controlname

~~~

Hi Carol, I know we have done a core dump on you today ... give it at
least a night or two of sleep to let things sink in ...

Do not ever feel we are bothered when you ask questions, that is why we
are here, we want to help you

"I have a Report for the results of the form that prints the filtered
data and ALL images associated with that record"

you could further filter the report using the method I gave you above
<smile>

*****
You can find some detailed instructions for building a WhereCondition
for the OpenReport action in this thread (you need do no more than one
condition though):

http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.access&tid=ce386a4e-2188-47f6-95ad-af3cd571d52f&cat=en-us-office-access&lang=en&cr=US&sloc=en-us&m=1&p=1

newsgroup: microsoft.public.access
subject: Re: Query Report Not showing any print preview outputs
date: Apr 5, 2008 5:47 AM EST
initial post: Apr 3, 2008 10:52 pm EST

Warm Regards,
Crystal

*
(: have an awesome day :)
*


carcher wrote:
Hello, again Crystal,

I have one more question...I'm sorry...I was just so consumed with the
multiple image problem for so long that I forgot to ask. Is it possible to
add something to this form to selectively enlarge and/or print the images
returned on the form? For example, if there were 4 images on a certain
record, and I wanted to enlarge and print 2 of them, is there a click event
or a hyperlink or something that I could use? I have a Report for the
results of the form that prints the filtered data and ALL images associated
with that record, but I was asked if the images could be selected
individually.

Many thanks,

Carol


"carcher" wrote:

Crystal,

You rock! I appreciate your patience as well as your expertise. Many
thanks for all that you do here...it's great encouragement for beginners like
myself. I look forward to completing the reading material that you pointed
me to...it really sheds some light. Thanks again.

I hope YOU have an awesome day!

Carol


"strive4peace" wrote:

Hi Carol,

"Typed on the AfterUpdate evnet of cboImageStartNum -->
=ShowImages()"

"I don't think it's firing off, but it shows up in red when viewing code."

=ShowImages()
gets typed into the PROPERTY itself, NOT in the code ... read this and
pay close attention to the section on Code Behind Forms (CBF)

Access Basics (on Allen Browne's site)
http://www.allenbrowne.com/casu-22.html
8-part free tutorial that covers essentials in Access

Allen has a wealth of information on his site; after you get to the
bottom of this link, click on 'Index of Tips'

~~~

always compile your code before testing it...


'~~~~~~~~~ Compile ~~~~~~~~~

Whenever you change code or references, your should always compile
before executing.

from the menu in a VBE (module) window: Debug, Compile

fix any errors on the yellow highlighted lines

keep compiling until nothing happens (this is good!)

~~~
"There is a public function to getimagepath, but the code to populate
the image control with imagepath & imagename is located in the subform
(which is based on the tblImage table)"

*** How to Create a Standard (General) Module ***

1. from the database window, click on the Module tab
2. click on the NEW command button
3. type (or paste) the code in

once the code is in the module ***, from the menu, do -->
Debug,Compile

if there are no syntax/reference errors, nothing will appear to happen
-- in this case, nothing happening is good <g>

Make sure to give the module a good name when you save it. You can have
several procedures (Subs and Functions) in a module, which gives you a
way to categorize them ... ie: basic procedures that would be useful in
any database; procedures that are specific to a particular database;
procedures for converting data; etc

~~~
"the subform control itself (not the subform name located inside it) is
named tblImage"

YOU should always choose a good name when controls are made (you will
learn that when you read the Access Basics document) -- you probably
used a wizard to make the subform control and that is what you put into
it -- you should not, btw, allow users to directly manipulate a table,
that should be done with a form or subform -- so you should make a form
based on tblImage and use that as a subform (read the section on
Mainform/subforms)

~~~

"I had copied main forms ImageName1...ImageName5 controls from
subform, so they were bound to tblImage table's ImageName field instead
of unbound. When I deleted the recordsource, they show up empty now. I
hope that is what is intended."

do not use the wizards to make your controls; turn on the toolbox and
set the properties yourself. The Access Basics document tells you the
common properties to set for a textbox control and what each one is for.
I should have specified that the *ControlSource* of these controls
should be blank ... and I did tell you that they should be on the main
form (sorry, I know it is a little overwhelming)

Warm Regards,
Crystal

*
(: have an awesome day :)
*


carcher wrote:
...oops...I had copied main forms ImageName1...ImageName5 controls from
subform, so they were bound to tblImage table's ImageName field instead of
unbound. When I deleted the recordsource, they show up empty now. I hope
that is what is intended.

"carcher" wrote:

Hello, Crystal.

So sorry to be taking up so much of your time, but I your help is much
appreciated.

I'm doing something wrong, and I don't know what. I copied the functions
and controls into the main form (which is the search form for structures
data). I don't know what to do with the combobox...
Typed =UpdateImageStartNumAndShowImages() into the main form's current
event, and keep getting syntax error...moved it to After_Update on form
(since this is the form where filtered data shows (filter button is on header
of main form along with unbound search textboxes...filtered data fields are
in detail of main form), and I can use the form, the subform still shows
correct data, but the main form's imagename controls show #Name?

Typed on the AfterUpdate evnet of cboImageStartNum -->
=ShowImages()

I don't think it's firing off, but it shows up in red when viewing code.

There is a public function to getimagepath, but the code to populate the
image control with imagepath & imagename is located in the subform (which is
based on the tblImage table).

Something else that is confusing me is that the subform control itself (not
the subform name located inside it) is named tblImage...just like the table
that holds the image data.

Hope I haven't muddied the water too much. Thank you again.

Carol






"strive4peace" wrote:

Hi Caol,

ps

oops, forgot something...

add this statement in ShowImages under
Me("ImageName" & ImageNum) = .ImageName
-->

Me("ImageName" & ImageNum).Visible = True



Warm Regards,
Crystal

*
(: have an awesome day :)
*


strive4peace wrote:
Show Multiple Images for Continuous Subform with Filename
~~~~~~

Hi Carol,

you're welcome ;)

"Is there a way to show each image for each record? Maybe using
multiple image frames and some procedure to fill them for records that
have multiple images?"

yes, try this:

.


Quantcast