I would like to create and print a production worksheet, and store certain information from past jobs in the database for easy reference and duplication. Access seems like a simple way to accomplish this, but I also need to generate and draw an image (a preview of a file) and be able to display and alter it at the user's control.
We have Access 2000, but upgrading is not out of the question. I can't, however, find much in the way of VBA functionality to accomplish this last goal. The Line method, if it's not prohibitive to draw anywhere from 5k-30k lines, would suffice but the help file says it only applies to reports. I need to be able to draw some or all of the file as the user is entering the information (to properly assign color values to certain parts of the image).
Is this just outside of the proper scope of Access, or is it feasible? If so, can someone point me in the right direction of how to accomplish this?
6 19230
To the best of my knowledge, in Access as far as Graphics go, you are pretty much restricted to drawing: Lines, Rectangles, Circles, Arcs, and Ellipses. These Graphics Methods can only be used in a Report within the Print() Event. Don't quote me on all this, since I seldom use this functionality. To see what I mean, place the following code in the Print() Event of a Blank Report, then Open it: - Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
-
Const conPI = 3.14159265359
-
Dim sngHCtr As Single, sngVCtr As Single
-
Dim sngRadius As Single
-
Dim sngStart As Single, sngEnd As Single
-
-
sngHCtr = Me.ScaleWidth / 2 ' Horizontal center.
-
sngVCtr = Me.ScaleHeight / 3
-
sngRadius = Me.ScaleHeight / 3 ' Circle radius.
-
-
' Draw circle.
-
Me.Circle (sngHCtr, sngVCtr), sngRadius
-
sngStart = -0.00000001 ' Start of pie slice.
-
sngEnd = -2 * conPI / 3 ' End of pie slice.
-
Me.FillColor = RGB(255, 0, 0) ' Color pie slice red.
-
Me.FillStyle = 0 ' Fill pie slice.
-
-
' Draw pie slice within circle.
-
Me.Circle (sngHCtr, sngVCtr), sngRadius, , sngStart, sngEnd
-
-
Me.FillColor = RGB(0, 0, 255) 'Blue fill for Rectangle (Box)
-
' Draw line as a box.
-
Me.Line (500, 6000)-(Me.ScaleWidth - 1000, 7000), vbBlue, B
-
End Sub
I think what you seek to do is really outside Access territory - it just is not good for complicated graphics of any sort. Where my user have needed such reporting I tend to export relevant data to Excel and let the users present in the format they need.
CorelDraw has VBA capability and I wonder whether that might be a more appropriate tool. I've never tried the Corel implementation of VBA, so I can't give any more guidance on precisely what to do.
I agree with YouMike here. Rather than a vector drawing package however, to me your requirement is very much in AutoCad territory - 30k lines would be just a small meal for AutoCad. It's not in the scope of Access at all, I reckon.
-Stewart
Ah, I was afraid of that. I should mention that there's no real need to do anything but pile the lines on top of each other, I'm not manipulating them in any fashion (so AutoCAD for example is overkill). 30k is on the extreme end, but I think it wouldn't take unreasonably long.
The other important part is retention of the info, so I guess I'll have to learn how to do some database stuff in a programming language and go from there. I still have yet to do any real Windows programming, so this looks like it will be a learning experience on multiple fronts.
Thanks for the feedback.
Ah, I was afraid of that. I should mention that there's no real need to do anything but pile the lines on top of each other, I'm not manipulating them in any fashion (so AutoCAD for example is overkill). 30k is on the extreme end, but I think it wouldn't take unreasonably long.
The other important part is retention of the info, so I guess I'll have to learn how to do some database stuff in a programming language and go from there. I still have yet to do any real Windows programming, so this looks like it will be a learning experience on multiple fronts.
Thanks for the feedback.
In order to retain the information, in this case X and Y coordinates, you can save these Values as Fields in a Table, something like: -
Dim X_1 As Integer
-
Dim X_2 As Integer
-
Dim Y_1 As Integer
-
Dim Y_2 As Integer
-
-
X_1 = 3600
-
X_2 = 3600
-
Y_1 = 0
-
Y_2 = 8000
-
-
Me.Line (X_1, Y_1)-(X_2, Y_2), rgBlue
-
I suggested CorelDraw without registering the need for 30k lines properly. Don't use AutoCad myself, but I have a son who does - his expertise is sea-bed mapping, which poses similar problems. I haven't asked him this specific question, but I know he would support that route. As Adrian says, if the need is just record simple line parameters, a table within Access might be a solution. It depends on what subsequent manipulation is needed.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steve Long |
last post by:
Hello, (total GDI newbie)
I'm having trouble drawing just a simple line to display in a picturebox. I
just want a straight, dotdash line.
I have two methods, one works and one doesn't (it cause...
|
by: Paul Hoad |
last post by:
I'm trying to use MeasureString() to determine the length in pixels of a
string
However to do I need a System.Drawing.Graphics object
to do this I need to create a System.Drawing.Graphics...
|
by: Stuart Norris |
last post by:
Dear Readers,
I am attempting to draw box around some text using unicode on
multiline label. The label is forty characters wide and 12 lines deep.
I have been trying to draw a box around text...
|
by: Hadar |
last post by:
Hi,
I'm getting "object is currently in use elsewhere" when I use
System.Drawing.Graphics.MesureString.
This is what I do:
My controls use a utility class the helps it to mesure strings.
To...
|
by: Metallicraft |
last post by:
I have a vb6 application. On the main form is a picture
box with one or two images and several pieces of text
displayed in it. These are created on the fly using gdi32
routines that are all in a...
|
by: Peter Proost |
last post by:
Hi group,
I got the following piece of code which draws a square with stars round it,
now I want the stars to rotate round the square, I can do this with the
mx.rotate and a timer and an...
|
by: Eduard Witteveen |
last post by:
Hello list,
I have code the draw MyDrawingObject information on a
System.Drawing.Graphics object. The code is more/less the following:
I now want to rotate / mirror the object i draw.
I've...
|
by: davetelling |
last post by:
I am not a programmer, I'm an engineer trying to make an interface to a
product I'm designing. I have used C# to make a form that interrogates the
unit via the serial port and receives the data. I...
|
by: Hasim AH |
last post by:
Hi ..
Just getting interested to learn C# and needs help.
I want to write C# application so that the program will execute and draw graphics when the user select the drawing menu from the main...
|
by: Carl |
last post by:
I'm new to C#, and I have only limited programming experience. I've
been doing the video tutorials at MS's website, and they're very
helpful, but I decided to experiment with GDI+ and have gotten...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |