473,386 Members | 2,129 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,386 software developers and data experts.

How to move image on report using Detail OnFormat Event?

I have a problem of changing the placement of an embedded image for a report/print. The initial left measurement of the image format is set to 0. I desire to move the image to the right during a Detail section On Format Event.
Starting with a simple command to move the embedded OLE field 1 inch to the right I have set up a Detail On Format Event of:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Me.[Image].Left = 1440
  3. End Sub
However, the print output does not move the image. The field name is [Image] and does not have any fields or other information on the right side of it on the Detail section. Once I know this works I will add smarter testing and improve my form, but this simple
Event command does not work for me.
Nov 22 '10 #1
4 3485
MMcCarthy
14,534 Expert Mod 8TB
Are you sure that Image is the name of the image frame on the report? In design view check the properties of the image frame, in particular the name property which is located on the Other tab.

Also open the form in preview rather than normal when testing this.
Nov 22 '10 #2
TheSmileyCoder
2,322 Expert Mod 2GB
What MMcCarthy wrote is good advice, im just adding to it:
When debugging, You should always start by making sure the event is firing. Add a msgbox or debug statement to your code, and verify that the event is firing. If it is firing, check post #2. If it is not firing, and your using Ac2007, make sure to open report in Preview, not in layout.
Nov 23 '10 #3
Still no change. Good idea to put tracers in the Event. I did change the names of my Report fields (Property Sheet/Other/Name) to be different from the table field names in case there was confusion. I modified my On Format Event to say:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Me.OLEimage.Left = 1440 ' one inch in TWIPS
  3. Me.LastName.Left = 1440 '
  4. Debug.Print "Me.OLEimage.Left: " & Me.OLEimage.Left
  5. MsgBox "Me.OLEimage.Left: " & Me.OLEimage.Left
  6. End Sub
This should move both the image and name fields from the default 0 inch to 1 inch from the left on the report. I then click -Debug/Compile members- and have no errors there. My weakness now is understanding how to render the feedback onto my Visual Basic tools window. Just Print Previewing does nor populate Immediate or Watches windows with information (I don't understand how to associate the tools to the event). Sorry to be such a novice about these things. This seemed like a simple table and report when I started, and I am determined to have it my way. I am refusing to port the table into MS Word for the output.
Nov 23 '10 #4
So simple. I did not have VBA content enabled. I have not used access since Access 97 was out. Now I see results and debug is talking to me. Thanks for your suggestions. -Al.
Nov 24 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Thierry Schmitt | last post by:
Hello all, I m quite sure that s a common problem and even that the answer to it has been given somewhere, forgive my lack of perspicacity but here is my problem: In the vba code of a button on...
1
by: Jordan Fee | last post by:
I'd like to perform some conditional formatting in the OnFormat Event of my Parent Report. This works fine, until my subreports are blank, then the invalid references start happening. I understand...
1
by: L.M. via AccessMonster.com | last post by:
I am using MS Access 2000. I have created a table of contents for a report, and I am updating the pages in the OnFormat Event (I don't want to do it on the OnPrint because they may be viewing it...
1
by: Nigel C | last post by:
Hi, I am going round in circles... I am trying to produce a report based upon the information gathered into a temp table. Each column (stored as a text field) in the table holds weekly...
3
by: David W. Fenton | last post by:
I ran into a weird problem with a subreport with an OnFormat event of the subreport detail. When I view the field list in report design view, all the aliased fields in the recordsource are...
4
by: Rico | last post by:
Hello, I'm looking for a way to force a pagebreak in code. I'm having a tough time, the first page formats properly until the condition is met and then forces a new page. The problem is, every...
2
by: Hellotalktome13 | last post by:
Using a simple ASP.net page with a crystal report on it. Loading from IIS using Integrated Secruity in the reports connection string it populates the report in the browser. What User ID and...
2
by: airdata | last post by:
Hi I currently have the following code attached to a command button on a switchboard form. This is basic Access 2000. Private Sub Print_daily_reports_button_Click() On Error GoTo NoData...
1
by: Peter Herath | last post by:
I have created a report using sample codes taken by the forum. one problem is that the report displays the field/column names in the table in columnar format(field names display in rows.) but i want...
4
by: Karl | last post by:
How do you set the width of a control in the detail section of a report using the On Format event for the detail section?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...

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.