Datebase Hits Max!


T

taupe42

I am a novice at Access. I have just discovered there is a limit to
the size of the database which I have just passed. I keep records of a
coin collection in the database along with a photo of the coin. The
jpg of the coin is evidently what has caused my database to hit the
max in size. Can anyone suggest a different way of handling the jpg
that would not take up the same amount of room? Someone suggested
using an "open source database" Like "MySQL", but I am guessing it is
beyond my novice standing.

Thanks in advance

Ron
 
Ad

Advertisements

F

Fred

I heard (but don't know) that Access 2007 fixed the problem, but Access 2003
and older had explosive bloat and numerous other problems when you put
pictures in using it "recommended" OLE object field method.

On method is to store the files outsid of access, and put a link / path to
the file into a simple text field. Now your trick is how do you see it on
the screen (= in forms) and print it out (=in reports). It's a little tricky
for us non-access-jocks (takes some code) I learned it in these access
forums a year ago, did it, but am not fluent enough to describe it here.
I'd recommending searching this section and the programming section of this
forum....it's there.
 
K

Klatuu

It will be easy enough to solve your problem. Keeping photos in the database
is why you have hit the limit. The better way to do this is to create a
folder to store your photos in. Then use a hyperlink field in your table
that is the path to the folder and photo file name. You can use the
FollowHyperlink method to open the photos.

After you have removed the photos, be sure to do a compact and repair.
 
T

taupe42

It will be easy enough to solve your problem.  Keeping photos in the database
is why you have hit the limit.  The better way to do this is to create a
folder to store your photos in.  Then use a hyperlink field in your table
that is the path to the folder and photo file name.  You can use the
FollowHyperlink method to open the photos.

After you have removed the photos, be sure to do a compact and repair.
--
Dave Hargis, Microsoft Access MVP







- Show quoted text -

Thanks for your reply. You do make it sound easy, but keep in mind
that you are dealing with a novice. I noticed that the under data time
on the table desing there is a hyper link item. The information that
goes with that is a little puzzling. Could I trouble you with some
help in that area. My file is C:\chips\chipscans and each of my jpgs
are numbered, such as 1202. Would it take code in the "format" box or
just a loacation such as above, "c:\chips\chipscans\1202.jpg".
 
K

Klatuu

You can store a value like
c:\chips\chipscans\1202.jpg
in a hyperlink field. You can also store it in a text field, but using a
hyperlink makes it much easier to open the photo and see it. You just use
the FollowHyperlink method or action depending on whether you are using VBA
or a macro.

You would not use a format box.
Since you are a novice, the easiest way would be to start with a text box on
your form and enter path and filename. Then run the FollowHyperLink from the
click of a command button. Open your VBA editor, click on help, and type in
FollowHyperlink. You will get a description of how to do it there.
 
T

taupe42

It will be easy enough to solve your problem.  Keeping photos in the database
is why you have hit the limit.  The better way to do this is to create a
folder to store your photos in.  Then use a hyperlink field in your table
that is the path to the folder and photo file name.  You can use the
FollowHyperlink method to open the photos.

After you have removed the photos, be sure to do a compact and repair.
--
Dave Hargis, Microsoft Access MVP







- Show quoted text -

I appreciate you reply and I should preface this by saying calling
myself a novice was probably giving myself too much credit. I have
never dealt with code and when I look up FollowHyperlink it certainly
looks like greek. On my table, I can create a field and have the data
type text or hyperlink. If it is text, I can see how putting the
source of my photo such as "C:\Chips\Chip Scans\1202.jpg" in that text
box would certainly create a unique location for each of my photos for
each item in my list. If I make the data type a hyperlink, it also
makes sense. Where I get lost is how to apply it to my form. I have an
autonumber as part of my form, and I just my form using a query that
asks for that autonumber and the form comes up with the correct item
showing the individual information for that item which hopefully would
include the photo. How do I get the photo that is represented by "C:
\Chips\Chip Scans\1202.jpg" in by database to come up?

When I look up FollowHyperlink, I find "expression.Follow(NewWindow,
AddHistory, ExtraInfo, Method, HeaderInfo)". When reading what each of
the variable represent, I do not see how it applies to by form or
database. I get very lost at that point. Any easy pointes?

Thank you
Ron
 
Ad

Advertisements

E

Evi

It will be easy enough to solve your problem. Keeping photos in the database
is why you have hit the limit. The better way to do this is to create a
folder to store your photos in. Then use a hyperlink field in your table
that is the path to the folder and photo file name. You can use the
FollowHyperlink method to open the photos.

After you have removed the photos, be sure to do a compact and repair.
--
Dave Hargis, Microsoft Access MVP







- Show quoted text -

I appreciate you reply and I should preface this by saying calling
myself a novice was probably giving myself too much credit. I have
never dealt with code and when I look up FollowHyperlink it certainly
looks like greek. On my table, I can create a field and have the data
type text or hyperlink. If it is text, I can see how putting the
source of my photo such as "C:\Chips\Chip Scans\1202.jpg" in that text
box would certainly create a unique location for each of my photos for
each item in my list. If I make the data type a hyperlink, it also
makes sense. Where I get lost is how to apply it to my form. I have an
autonumber as part of my form, and I just my form using a query that
asks for that autonumber and the form comes up with the correct item
showing the individual information for that item which hopefully would
include the photo. How do I get the photo that is represented by "C:
\Chips\Chip Scans\1202.jpg" in by database to come up?

When I look up FollowHyperlink, I find "expression.Follow(NewWindow,
AddHistory, ExtraInfo, Method, HeaderInfo)". When reading what each of
the variable represent, I do not see how it applies to by form or
database. I get very lost at that point. Any easy pointes?

Thank you
Ron

Not surprised, the Help makes it sound more complicated than it is.
I made my field's Datatype to text and it worked fine.
I suggest having 2 paths, one called MyPath and one called MyPic.
Make both text fields.
You can make the usual file path to your pictures the Default Value in
MyPath (if they are all in the same folder eg
C:\Chips\Chip Scans\
In MyPic you would type in
1202.jpg


You create your form and those 2 fields are now in their text boxes. In the
form's design view, click on MyPic. Click on the Properties button and turn
to the Events tab.
Click next to Double Click (this means that you can open up the picture
whenever you double-click on the MyPic field)

Choose Event Procedure

Click just right of that and a code page will open up with some writing
already in it.

Just above where it says End Sub paste in the following 1 line


Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet


You need the 5 commas after MyPic
(change the bit that says MyPath and MyPic to your real field names if you
don't want mine)



See if this does it.

Evi
 
T

taupe42

I appreciate you reply and I should preface this by saying calling
myself a novice was probably giving myself too much credit. I have
never dealt with code and when I look up FollowHyperlink it certainly
looks like greek. On my table, I can create a field and have the data
type text or hyperlink. If it is text, I can see how putting the
source of my photo such as "C:\Chips\Chip Scans\1202.jpg" in that text
box would certainly create a unique location for each of my photos for
each item in my list. If I make the data type a hyperlink, it also
makes sense. Where I get lost is how to apply it to my form. I have an
autonumber as part of my form, and I just my form using a query that
asks for that autonumber and the form comes up with the correct item
showing the individual information for that item which hopefully would
include the photo. How do I get the photo that is represented by "C:
\Chips\Chip Scans\1202.jpg" in by database to come up?

When I look up FollowHyperlink, I find "expression.Follow(NewWindow,
AddHistory, ExtraInfo, Method, HeaderInfo)". When reading what each of
the variable represent, I do not see how it applies to by form or
database. I get very lost at that point. Any easy pointes?

Thank you
Ron

Not surprised, the Help makes it sound more complicated than it is.
I made my field's Datatype to text  and it worked fine.
I suggest having 2 paths, one called MyPath and one called MyPic.
Make both text fields.
You can make the usual file path to your pictures the Default Value in
MyPath (if they are all in the same folder eg
C:\Chips\Chip Scans\
In MyPic you would type in
1202.jpg

You create your form and those 2 fields are now in their text boxes.  Inthe
form's design view, click on MyPic. Click on the Properties button and turn
to the Events tab.
Click next to Double Click (this means that you can open up the picture
whenever you double-click on the MyPic field)

Choose Event Procedure

Click just right of that and a code page will open up with some writing
already in it.

Just above where it says End Sub paste in the following 1 line

Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet

You need the 5 commas after MyPic
(change the bit that says MyPath and MyPic to your real field names if you
don't want mine)

See if this does it.

Evi- Hide quoted text -

- Show quoted text -

Thanks for your quick reply. I believe I followed what you said but
nothing happens when I double click.

I created two new fields with the names you indicated and they were
both text boxes. In the the two boxes I put in the path to the photos
and the other the number of the jpg. Just as you indicated. I added
the two text boxes to my form
and then followed your intructions for the event procedure on the
double click. After the addition, it now looks like this:

Private Sub Command404_Click()
On Error GoTo Err_Command404_Click


Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_Command404_Click:
Exit Sub

Err_Command404_Click:
MsgBox Err.Description
Resume Exit_Command404_Clic
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , ,
msoMethodGet

End Sub

When I go back to the form and double click on the text box MyPic, I
get nothing.

What did I do wrong? Your instruction seemed quite simple.

Ron
 
E

Evi

I appreciate you reply and I should preface this by saying calling
myself a novice was probably giving myself too much credit. I have
never dealt with code and when I look up FollowHyperlink it certainly
looks like greek. On my table, I can create a field and have the data
type text or hyperlink. If it is text, I can see how putting the
source of my photo such as "C:\Chips\Chip Scans\1202.jpg" in that text
box would certainly create a unique location for each of my photos for
each item in my list. If I make the data type a hyperlink, it also
makes sense. Where I get lost is how to apply it to my form. I have an
autonumber as part of my form, and I just my form using a query that
asks for that autonumber and the form comes up with the correct item
showing the individual information for that item which hopefully would
include the photo. How do I get the photo that is represented by "C:
\Chips\Chip Scans\1202.jpg" in by database to come up?

When I look up FollowHyperlink, I find "expression.Follow(NewWindow,
AddHistory, ExtraInfo, Method, HeaderInfo)". When reading what each of
the variable represent, I do not see how it applies to by form or
database. I get very lost at that point. Any easy pointes?

Thank you
Ron

Not surprised, the Help makes it sound more complicated than it is.
I made my field's Datatype to text and it worked fine.
I suggest having 2 paths, one called MyPath and one called MyPic.
Make both text fields.
You can make the usual file path to your pictures the Default Value in
MyPath (if they are all in the same folder eg
C:\Chips\Chip Scans\
In MyPic you would type in
1202.jpg

You create your form and those 2 fields are now in their text boxes. In the
form's design view, click on MyPic. Click on the Properties button and turn
to the Events tab.
Click next to Double Click (this means that you can open up the picture
whenever you double-click on the MyPic field)

Choose Event Procedure

Click just right of that and a code page will open up with some writing
already in it.

Just above where it says End Sub paste in the following 1 line

Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet

You need the 5 commas after MyPic
(change the bit that says MyPath and MyPic to your real field names if you
don't want mine)

See if this does it.

Evi- Hide quoted text -

- Show quoted text -

Thanks for your quick reply. I believe I followed what you said but
nothing happens when I double click.

I created two new fields with the names you indicated and they were
both text boxes. In the the two boxes I put in the path to the photos
and the other the number of the jpg. Just as you indicated. I added
the two text boxes to my form
and then followed your intructions for the event procedure on the
double click. After the addition, it now looks like this:

Private Sub Command404_Click()
On Error GoTo Err_Command404_Click


Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_Command404_Click:
Exit Sub

Err_Command404_Click:
MsgBox Err.Description
Resume Exit_Command404_Clic
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , ,
msoMethodGet

End Sub

When I go back to the form and double click on the text box MyPic, I
get nothing.

What did I do wrong? Your instruction seemed quite simple.

Ron


Just to Check Ron, these 2 textboxes should be fields in your table, not
just text boxes into which you have written.

The code looks as if , rather than clicking on the text box field to add
your code to its double-click event, you have put a command button into your
form - one that would normally put your cursor on the previous field - thats
the bit that says

Screen.PreviousControl.SetFocus
DoCmd.FindNext

You've put your line of code in the bit that would only happen if there was
an error

The bit in the code that says
On Error GoTo Err_Command404_Click
just means
if something goes barf then go down to the line that says
Err_Command404_Click and do whatever it tells you to after that.



If you want to use a button then the code would look like this
I've put some explanations in it, they are the lines that start with a '
They will turn green when you paste them into a module and this means that
they won't effect the code in any way.
If any of them turn red, it will be because a line has been broken up in the
email, just delete the line break so that they become one line again

I've de-mystified the unnecessarily pompous bits of code, leaving the bits
that are actually necessary to make it work


Private Sub Command404_Click()
On Error GoTo MyCodeBarfed

'the next bit should all be one line
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet

LetsGetOutOfThis:
'stop the sub
Exit Sub

MyCodeBarfed:
MsgBox Err.Description
'tell them what went wrong
Resume LetsGetOutOfThis
'go back to the line
'that says LetsGetOutOfThis
End Sub

Evi
 
T

taupe42

Thanks for your quick reply. I believe I followed what you said but
nothing happens when I double click.

I created two new fields with the names you indicated and they were
both text boxes. In the the two boxes I put in the path to the photos
and the other the number of the jpg. Just as you indicated. I added
the two text boxes to my form
and then followed your intructions for the event procedure on the
double click. After the addition, it now looks like this:

Private Sub Command404_Click()
On Error GoTo Err_Command404_Click

    Screen.PreviousControl.SetFocus
    DoCmd.FindNext

Exit_Command404_Click:
    Exit Sub

Err_Command404_Click:
    MsgBox Err.Description
    Resume Exit_Command404_Clic
    Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , ,
msoMethodGet

End Sub

When I go back to the form and double click on the text box MyPic, I
get nothing.

What did I do wrong? Your instruction seemed quite simple.

Ron

Just to Check Ron, these 2 textboxes should be fields in your table, not
just text boxes into which you have written.

The code looks as if , rather than clicking on the text box field to add
your code to its double-click event, you have put a command button into your
form - one that would normally put your cursor on the previous field - thats
the bit that says

Screen.PreviousControl.SetFocus
    DoCmd.FindNext

You've put your line of code in the bit that would only happen if there was
an error

The bit in the code that says
On Error GoTo Err_Command404_Click
just means
if something goes barf then go down to the line that says
Err_Command404_Click and do whatever it tells you to after that.

If you want to use a button then the code would look like this
I've put some explanations in it, they are the lines that start with a '
They will turn green when you paste them into a module and this means that
they won't effect the code in any way.
If any of them turn red, it will be because a line has been broken up in the
email, just delete the line break so that they become one line again

I've de-mystified the unnecessarily pompous bits of code, leaving the bits
that are actually necessary to make it work

Private Sub Command404_Click()
On Error GoTo MyCodeBarfed

'the next bit should all be one line
    Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet

LetsGetOutOfThis:
'stop the sub
    Exit Sub

MyCodeBarfed:
    MsgBox Err.Description
'tell them what went wrong
    Resume LetsGetOutOfThis
'go back to the line
'that says LetsGetOutOfThis
End Sub

Evi- Hide quoted text -

- Show quoted text -

EVI:

I appreciate your patience on this problem. You are to be commended.
First of all, the 2 text boxes I added as to my table so hopefully I
did that part correctly.

I did have a command button on my form because I was trying all
possibilities. If this caused your code not to work, I apologize.
Since your last response, I went back to my original table (I have
been working with copies until I get this right) and deleted the
command button and started from scratch with your original code
suggestion.

At the point you indicated to "click just to the right of the [event
procedure] the code page does open up with some writing already in it.
The cursor goes to the space directly above "End Sub" at the bottom of
the writing. Before I add the code line you suggested, it reads as
follows:

Private Sub Command322_Click()
On Error GoTo Err_Command322_Click


DoCmd.GoToRecord , , acNext

Exit_Command322_Click:
Exit Sub

Err_Command322_Click:
MsgBox Err.Description
Resume Exit_Command322_Click

End Sub
Private Sub Command323_Click()
On Error GoTo Err_Command323_Click


DoCmd.GoToRecord , , acLast

Exit_Command323_Click:
Exit Sub

Err_Command323_Click:
MsgBox Err.Description
Resume Exit_Command323_Click

End Sub
Private Sub Command327_Click()
On Error GoTo Err_Command327_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command327_Click:
Exit Sub

Err_Command327_Click:
MsgBox Err.Description
Resume Exit_Command327_Click

End Sub
Private Sub Command379_Click()
On Error GoTo Err_Command379_Click


DoCmd.GoToRecord , , acLast

Exit_Command379_Click:
Exit Sub

Err_Command379_Click:
MsgBox Err.Description
Resume Exit_Command379_Click

End Sub
Private Sub Command380_Click()
On Error GoTo Err_Command380_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command380_Click:
Exit Sub

Err_Command380_Click:
MsgBox Err.Description
Resume Exit_Command380_Click

End Sub
Private Sub Command381_Click()
On Error GoTo Err_Command381_Click


DoCmd.GoToRecord , , acNext

Exit_Command381_Click:
Exit Sub

Err_Command381_Click:
MsgBox Err.Description
Resume Exit_Command381_Click

End Sub
Private Sub Command384_Click()
On Error GoTo Err_Command384_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command384_Click:
Exit Sub

Err_Command384_Click:
MsgBox Err.Description
Resume Exit_Command384_Click

End Sub

Private Sub Text393_DblClick(Cancel As Integer)

End Sub


Hopefully I have given you enough? I then have cut pasted the line of
code directly above the "End Sup".
At this point, I am not quite sure of the procedure to get back to my
form. I did hit the save buttonon the tool bar and then return using
the "X" in the upper right hand corner of the page. Next to the
"Double Click" on the Event tab the [Event Procedure] is there so I am
assuming all is well so far. Again I hit the save button as a
precaution.

Going back to my form view, the text box reads 1202.jpg which is what
I put in the table. When I double click on this text box now, I am
taken immediately to the code line that I just pasted. There is a box
that pops up that indicates a "Compile error: Method or data member
not found". I looked at the help button attached to this error
message, Error 461 by the way, and it referred to mispelled "object or
member names". I have since double checked my field names and they
appear to be what they are suppose to be, MyPath and MyPic and both
have the data time indicated as TEXT.

When I hit the OK button on the error message it goes into the code:

Private Sub Text393_DblClick(Cancel As Integer)
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet
End Sub

The first line only is highlighted in YELLOW and the".MyPath" is
highlighted in BLUE.

The good news is that I am getting a response when I double click on
the "MY PIC" field in my form. I did not really intend on using the
command button option and since this appears to be getting close, I
will stick with this concept.

Is this enough to figure out what is wrong?

Ron
 
E

Evi

Thanks for your quick reply. I believe I followed what you said but
nothing happens when I double click.

I created two new fields with the names you indicated and they were
both text boxes. In the the two boxes I put in the path to the photos
and the other the number of the jpg. Just as you indicated. I added
the two text boxes to my form
and then followed your intructions for the event procedure on the
double click. After the addition, it now looks like this:

Private Sub Command404_Click()
On Error GoTo Err_Command404_Click

Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_Command404_Click:
Exit Sub

Err_Command404_Click:
MsgBox Err.Description
Resume Exit_Command404_Clic
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , ,
msoMethodGet

End Sub

When I go back to the form and double click on the text box MyPic, I
get nothing.

What did I do wrong? Your instruction seemed quite simple.

Ron

Just to Check Ron, these 2 textboxes should be fields in your table, not
just text boxes into which you have written.

The code looks as if , rather than clicking on the text box field to add
your code to its double-click event, you have put a command button into your
form - one that would normally put your cursor on the previous field - thats
the bit that says

Screen.PreviousControl.SetFocus
DoCmd.FindNext

You've put your line of code in the bit that would only happen if there was
an error

The bit in the code that says
On Error GoTo Err_Command404_Click
just means
if something goes barf then go down to the line that says
Err_Command404_Click and do whatever it tells you to after that.

If you want to use a button then the code would look like this
I've put some explanations in it, they are the lines that start with a '
They will turn green when you paste them into a module and this means that
they won't effect the code in any way.
If any of them turn red, it will be because a line has been broken up in the
email, just delete the line break so that they become one line again

I've de-mystified the unnecessarily pompous bits of code, leaving the bits
that are actually necessary to make it work

Private Sub Command404_Click()
On Error GoTo MyCodeBarfed

'the next bit should all be one line
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet

LetsGetOutOfThis:
'stop the sub
Exit Sub

MyCodeBarfed:
MsgBox Err.Description
'tell them what went wrong
Resume LetsGetOutOfThis
'go back to the line
'that says LetsGetOutOfThis
End Sub

Evi- Hide quoted text -

- Show quoted text -

EVI:

I appreciate your patience on this problem. You are to be commended.
First of all, the 2 text boxes I added as to my table so hopefully I
did that part correctly.

I did have a command button on my form because I was trying all
possibilities. If this caused your code not to work, I apologize.
Since your last response, I went back to my original table (I have
been working with copies until I get this right) and deleted the
command button and started from scratch with your original code
suggestion.

At the point you indicated to "click just to the right of the [event
procedure] the code page does open up with some writing already in it.
The cursor goes to the space directly above "End Sub" at the bottom of
the writing. Before I add the code line you suggested, it reads as
follows:

Private Sub Command322_Click()
On Error GoTo Err_Command322_Click


DoCmd.GoToRecord , , acNext

Exit_Command322_Click:
Exit Sub

Err_Command322_Click:
MsgBox Err.Description
Resume Exit_Command322_Click

End Sub
Private Sub Command323_Click()
On Error GoTo Err_Command323_Click


DoCmd.GoToRecord , , acLast

Exit_Command323_Click:
Exit Sub

Err_Command323_Click:
MsgBox Err.Description
Resume Exit_Command323_Click

End Sub
Private Sub Command327_Click()
On Error GoTo Err_Command327_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command327_Click:
Exit Sub

Err_Command327_Click:
MsgBox Err.Description
Resume Exit_Command327_Click

End Sub
Private Sub Command379_Click()
On Error GoTo Err_Command379_Click


DoCmd.GoToRecord , , acLast

Exit_Command379_Click:
Exit Sub

Err_Command379_Click:
MsgBox Err.Description
Resume Exit_Command379_Click

End Sub
Private Sub Command380_Click()
On Error GoTo Err_Command380_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command380_Click:
Exit Sub

Err_Command380_Click:
MsgBox Err.Description
Resume Exit_Command380_Click

End Sub
Private Sub Command381_Click()
On Error GoTo Err_Command381_Click


DoCmd.GoToRecord , , acNext

Exit_Command381_Click:
Exit Sub

Err_Command381_Click:
MsgBox Err.Description
Resume Exit_Command381_Click

End Sub
Private Sub Command384_Click()
On Error GoTo Err_Command384_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command384_Click:
Exit Sub

Err_Command384_Click:
MsgBox Err.Description
Resume Exit_Command384_Click

End Sub

Private Sub Text393_DblClick(Cancel As Integer)

End Sub


Hopefully I have given you enough? I then have cut pasted the line of
code directly above the "End Sup".
At this point, I am not quite sure of the procedure to get back to my
form. I did hit the save buttonon the tool bar and then return using
the "X" in the upper right hand corner of the page. Next to the
"Double Click" on the Event tab the [Event Procedure] is there so I am
assuming all is well so far. Again I hit the save button as a
precaution.

Going back to my form view, the text box reads 1202.jpg which is what
I put in the table. When I double click on this text box now, I am
taken immediately to the code line that I just pasted. There is a box
that pops up that indicates a "Compile error: Method or data member
not found". I looked at the help button attached to this error
message, Error 461 by the way, and it referred to mispelled "object or
member names". I have since double checked my field names and they
appear to be what they are suppose to be, MyPath and MyPic and both
have the data time indicated as TEXT.

When I hit the OK button on the error message it goes into the code:

Private Sub Text393_DblClick(Cancel As Integer)
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet
End Sub

The first line only is highlighted in YELLOW and the".MyPath" is
highlighted in BLUE.

The good news is that I am getting a response when I double click on
the "MY PIC" field in my form. I did not really intend on using the
command button option and since this appears to be getting close, I
will stick with this concept.

Is this enough to figure out what is wrong?

Ron


Hi Ron
I can see the problem. You seem to have only partly followed my
instructions. I see that you are no longer using a button but have decided
to doubleclick a text box - that's fine.
But (assuming that MyPath and MyPic are the names of the fields in your
Table) the way to add them to your form is, in Form Design View, click the
the Field List then drag those fields onto your form. These text boxes will
have the names MyPath and MyPic.

I can see from your code that you added a textbox control to your form and
its Name (in Properties, on the Other tab) is Text393. I can tell this from
the Click Code..


.. It is not called MyPic so when you tell the code to look for the value in
Me.MyPic, it expects to see a control (text box in this case) called MyPic.
Delete this text box and add a control as described above, If you don't want
to call your field names in your table MyPath and MyPic then we can adapt
the code to fit the field names you choose.

Evi
 
Ad

Advertisements

T

taupe42

Thanks for your quick reply. I believe I followed what you said but
nothing happens when I double click.
I created two new fields with the names you indicated and they were
both text boxes. In the the two boxes I put in the path to the photos
and the other the number of the jpg. Just as you indicated. I added
the two text boxes to my form
and then followed your intructions for the event procedure on the
double click. After the addition, it now looks like this:
Private Sub Command404_Click()
On Error GoTo Err_Command404_Click

Exit_Command404_Click:
Exit Sub
Err_Command404_Click:
MsgBox Err.Description
Resume Exit_Command404_Clic
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , ,
msoMethodGet
When I go back to the form and double click on the text box MyPic, I
get nothing.
What did I do wrong? Your instruction seemed quite simple.

Just to Check Ron, these 2 textboxes should be fields in your table, not
just text boxes into which you have written.
The code looks as if , rather than clicking on the text box field to add
your code to its double-click event, you have put a command button into your
form - one that would normally put your cursor on the previous field - thats
the bit that says

You've put your line of code in the bit that would only happen if there was
an error
The bit in the code that says
On Error GoTo Err_Command404_Click
just means
if something goes barf then go down to the line that says
Err_Command404_Click and do whatever it tells you to after that.
If you want to use a button then the code would look like this
I've put some explanations in it, they are the lines that start with a '
They will turn green when you paste them into a module and this means that
they won't effect the code in any way.
If any of them turn red, it will be because a line has been broken up in the
email, just delete the line break so that they become one line again
I've de-mystified the unnecessarily pompous bits of code, leaving the bits
that are actually necessary to make it work
Private Sub Command404_Click()
On Error GoTo MyCodeBarfed
'the next bit should all be one line
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet
LetsGetOutOfThis:
'stop the sub
Exit Sub
MyCodeBarfed:
MsgBox Err.Description
'tell them what went wrong
Resume LetsGetOutOfThis
'go back to the line
'that says LetsGetOutOfThis
End Sub
Evi- Hide quoted text -
- Show quoted text -

EVI:

I appreciate your patience on this problem. You are to be commended.
First of all, the 2 text boxes I added as to my table so hopefully I
did that part correctly.

I did have a command button on my form because I was trying all
possibilities. If this caused your code not to work, I apologize.
Since your last response, I went back to my original table (I have
been working with copies until I get this right) and deleted the
command button and started from scratch with your original code
suggestion.

At the point you indicated to "click just to the right of the [event
procedure] the code page does open up with some writing already in it.
The cursor goes to the space directly above "End Sub" at the bottom of
the writing. Before I add the code line you suggested, it reads as
follows:

Private Sub Command322_Click()
On Error GoTo Err_Command322_Click

    DoCmd.GoToRecord , , acNext

Exit_Command322_Click:
    Exit Sub

Err_Command322_Click:
    MsgBox Err.Description
    Resume Exit_Command322_Click

End Sub
Private Sub Command323_Click()
On Error GoTo Err_Command323_Click

    DoCmd.GoToRecord , , acLast

Exit_Command323_Click:
    Exit Sub

Err_Command323_Click:
    MsgBox Err.Description
    Resume Exit_Command323_Click

End Sub
Private Sub Command327_Click()
On Error GoTo Err_Command327_Click

    DoCmd.GoToRecord , , acPrevious

Exit_Command327_Click:
    Exit Sub

Err_Command327_Click:
    MsgBox Err.Description
    Resume Exit_Command327_Click

End Sub
Private Sub Command379_Click()
On Error GoTo Err_Command379_Click

    DoCmd.GoToRecord , , acLast

Exit_Command379_Click:
    Exit Sub

Err_Command379_Click:
    MsgBox Err.Description
    Resume Exit_Command379_Click

End Sub
Private Sub Command380_Click()
On Error GoTo Err_Command380_Click

    DoCmd.GoToRecord , , acPrevious

Exit_Command380_Click:
    Exit Sub

Err_Command380_Click:
    MsgBox Err.Description
    Resume Exit_Command380_Click

End Sub
Private Sub Command381_Click()
On Error GoTo Err_Command381_Click

    DoCmd.GoToRecord , , acNext

Exit_Command381_Click:
    Exit Sub

Err_Command381_Click:
    MsgBox Err.Description
    Resume Exit_Command381_Click

End Sub
Private Sub Command384_Click()
On Error GoTo Err_Command384_Click

    DoCmd.GoToRecord , , acNewRec

Exit_Command384_Click:
    Exit Sub

Err_Command384_Click:
    MsgBox Err.Description
    Resume Exit_Command384_Click

End Sub

Private Sub Text393_DblClick(Cancel As Integer)

End Sub

Hopefully I have given you enough? I then have cut pasted the line of
code directly above the "End Sup".
At this point, I am not quite sure of the procedure to get back to my
form. I did hit the save buttonon the tool bar and then return using
the "X" in the upper right hand corner of the page. Next to the
"Double Click" on the Event tab the [Event Procedure] is there so I am
assuming all is well so far. Again I hit the save button as a
precaution.

Going back to my form view, the text box reads 1202.jpg which is what
I put in the table. When I double click on this text box now, I am
taken immediately to the code line that I just pasted. There is a box
that pops up that indicates a "Compile error: Method or data member
not found". I looked at the help button attached to this error
message, Error 461 by the way, and it referred to mispelled "object or
member names". I have since double checked my field names and they
appear to be what they are suppose to be, MyPath and MyPic and both
have the data time indicated as TEXT.

When I hit the OK button on the error message it goes into the code:

Private Sub Text393_DblClick(Cancel As Integer)
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet
End Sub

The first line only is highlighted in YELLOW and the".MyPath" is
highlighted in BLUE.

The good news is that I am getting a response when I double click on
the "MY PIC" field in my form. I did not really intend on using the
command button option and since this appears to be getting close, I
will stick with this concept.

Is this enough to figure out what is wrong?

Ron

Hi Ron
I can see the problem. You seem to have only partly followed my
instructions. I see that you are no longer using a button but have decided
to doubleclick a text box - that's fine.
But (assuming that MyPath and MyPic are the names of the fields in your
Table) the way to add them to your form is, in Form Design View, click the
the Field List then drag those fields onto your form. These text boxes will
have the names MyPath and MyPic.

I can see from your code that you added a textbox control to your form and
its Name (in Properties, on the Other tab) is Text393. I can tell this from
the Click Code..

. It is not called MyPic so when you tell the code to look for the value in
Me.MyPic, it expects to see a control (text box in this case) called MyPic..
Delete this text box and add a control as described above, If you don't want
to call your field names in your table MyPath and MyPic then we can adapt
the code to fit the field names you choose.

Evi

I do not usually add via that procedure but it is very apparent why
that would work. I did recreate the field boxes using that method and
the double click work perfect. I cannot thank you enough. Thanks for
helping out a non-code user.

Ron
 
Ad

Advertisements

E

Evi

create
of
Thanks for your quick reply. I believe I followed what you said but
nothing happens when I double click.
I created two new fields with the names you indicated and they were
both text boxes. In the the two boxes I put in the path to the photos
and the other the number of the jpg. Just as you indicated. I added
the two text boxes to my form
and then followed your intructions for the event procedure on the
double click. After the addition, it now looks like this:
Private Sub Command404_Click()
On Error GoTo Err_Command404_Click

Exit_Command404_Click:
Exit Sub
Err_Command404_Click:
MsgBox Err.Description
Resume Exit_Command404_Clic
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , ,
msoMethodGet
When I go back to the form and double click on the text box MyPic, I
get nothing.
What did I do wrong? Your instruction seemed quite simple.

Just to Check Ron, these 2 textboxes should be fields in your table, not
just text boxes into which you have written.
The code looks as if , rather than clicking on the text box field to add
your code to its double-click event, you have put a command button into your
form - one that would normally put your cursor on the previous field - thats
the bit that says

You've put your line of code in the bit that would only happen if there was
an error
The bit in the code that says
On Error GoTo Err_Command404_Click
just means
if something goes barf then go down to the line that says
Err_Command404_Click and do whatever it tells you to after that.
If you want to use a button then the code would look like this
I've put some explanations in it, they are the lines that start with a '
They will turn green when you paste them into a module and this means that
they won't effect the code in any way.
If any of them turn red, it will be because a line has been broken up in the
email, just delete the line break so that they become one line again
I've de-mystified the unnecessarily pompous bits of code, leaving the bits
that are actually necessary to make it work
Private Sub Command404_Click()
On Error GoTo MyCodeBarfed
'the next bit should all be one line
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet
LetsGetOutOfThis:
'stop the sub
Exit Sub
MyCodeBarfed:
MsgBox Err.Description
'tell them what went wrong
Resume LetsGetOutOfThis
'go back to the line
'that says LetsGetOutOfThis
End Sub
Evi- Hide quoted text -
- Show quoted text -

EVI:

I appreciate your patience on this problem. You are to be commended.
First of all, the 2 text boxes I added as to my table so hopefully I
did that part correctly.

I did have a command button on my form because I was trying all
possibilities. If this caused your code not to work, I apologize.
Since your last response, I went back to my original table (I have
been working with copies until I get this right) and deleted the
command button and started from scratch with your original code
suggestion.

At the point you indicated to "click just to the right of the [event
procedure] the code page does open up with some writing already in it.
The cursor goes to the space directly above "End Sub" at the bottom of
the writing. Before I add the code line you suggested, it reads as
follows:

Private Sub Command322_Click()
On Error GoTo Err_Command322_Click

DoCmd.GoToRecord , , acNext

Exit_Command322_Click:
Exit Sub

Err_Command322_Click:
MsgBox Err.Description
Resume Exit_Command322_Click

End Sub
Private Sub Command323_Click()
On Error GoTo Err_Command323_Click

DoCmd.GoToRecord , , acLast

Exit_Command323_Click:
Exit Sub

Err_Command323_Click:
MsgBox Err.Description
Resume Exit_Command323_Click

End Sub
Private Sub Command327_Click()
On Error GoTo Err_Command327_Click

DoCmd.GoToRecord , , acPrevious

Exit_Command327_Click:
Exit Sub

Err_Command327_Click:
MsgBox Err.Description
Resume Exit_Command327_Click

End Sub
Private Sub Command379_Click()
On Error GoTo Err_Command379_Click

DoCmd.GoToRecord , , acLast

Exit_Command379_Click:
Exit Sub

Err_Command379_Click:
MsgBox Err.Description
Resume Exit_Command379_Click

End Sub
Private Sub Command380_Click()
On Error GoTo Err_Command380_Click

DoCmd.GoToRecord , , acPrevious

Exit_Command380_Click:
Exit Sub

Err_Command380_Click:
MsgBox Err.Description
Resume Exit_Command380_Click

End Sub
Private Sub Command381_Click()
On Error GoTo Err_Command381_Click

DoCmd.GoToRecord , , acNext

Exit_Command381_Click:
Exit Sub

Err_Command381_Click:
MsgBox Err.Description
Resume Exit_Command381_Click

End Sub
Private Sub Command384_Click()
On Error GoTo Err_Command384_Click

DoCmd.GoToRecord , , acNewRec

Exit_Command384_Click:
Exit Sub

Err_Command384_Click:
MsgBox Err.Description
Resume Exit_Command384_Click

End Sub

Private Sub Text393_DblClick(Cancel As Integer)

End Sub

Hopefully I have given you enough? I then have cut pasted the line of
code directly above the "End Sup".
At this point, I am not quite sure of the procedure to get back to my
form. I did hit the save buttonon the tool bar and then return using
the "X" in the upper right hand corner of the page. Next to the
"Double Click" on the Event tab the [Event Procedure] is there so I am
assuming all is well so far. Again I hit the save button as a
precaution.

Going back to my form view, the text box reads 1202.jpg which is what
I put in the table. When I double click on this text box now, I am
taken immediately to the code line that I just pasted. There is a box
that pops up that indicates a "Compile error: Method or data member
not found". I looked at the help button attached to this error
message, Error 461 by the way, and it referred to mispelled "object or
member names". I have since double checked my field names and they
appear to be what they are suppose to be, MyPath and MyPic and both
have the data time indicated as TEXT.

When I hit the OK button on the error message it goes into the code:

Private Sub Text393_DblClick(Cancel As Integer)
Application.FollowHyperlink Me.MyPath & Me.MyPic, , , , , msoMethodGet
End Sub

The first line only is highlighted in YELLOW and the".MyPath" is
highlighted in BLUE.

The good news is that I am getting a response when I double click on
the "MY PIC" field in my form. I did not really intend on using the
command button option and since this appears to be getting close, I
will stick with this concept.

Is this enough to figure out what is wrong?

Ron

Hi Ron
I can see the problem. You seem to have only partly followed my
instructions. I see that you are no longer using a button but have decided
to doubleclick a text box - that's fine.
But (assuming that MyPath and MyPic are the names of the fields in your
Table) the way to add them to your form is, in Form Design View, click the
the Field List then drag those fields onto your form. These text boxes will
have the names MyPath and MyPic.

I can see from your code that you added a textbox control to your form and
its Name (in Properties, on the Other tab) is Text393. I can tell this from
the Click Code..

. It is not called MyPic so when you tell the code to look for the value in
Me.MyPic, it expects to see a control (text box in this case) called MyPic.
Delete this text box and add a control as described above, If you don't want
to call your field names in your table MyPath and MyPic then we can adapt
the code to fit the field names you choose.

Evi

I do not usually add via that procedure but it is very apparent why
that would work. I did recreate the field boxes using that method and
the double click work perfect. I cannot thank you enough. Thanks for
helping out a non-code user.

Ron

I'm glad it worked but you are now a officially a Code-User :)
Evi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top