set field problem

U

Uhl

I use a hyperlinkfield called: "Ordner" and I have 2 buttons

1. The first one is to make a directory with a the information from a
field called Nachname. This works fine

2. The second one is to set the link to that directory into the
hyperlink field. I tried 2 different versions

When I copy it in with cut and paste it works. But when I copy it with
the code it looks fine, but when I click on the hyperlink it does not work.

code for 1.) [This works]
With CodeContextObject
MkDir "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
End With

code for 2.) [This works partly]
With CodeContextObject
..Ordner = "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname & "\"
End With

or [This works partly]

With CodeContextObject
..Ordner = "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
End With

Thanks
 
T

Tom van Stiphout

I would probably write:
Me.Ordner.HyperlinkAddress = "c:\test\"

-Tom.
Microsoft Access MVP
 
U

Uhl

That still does not work. I did find out that when I delete the last
caracter, which is the backslah it does work. But when I leave out the
backslah I have to delete the last character of the field and type it
back in.


I would probably write:
Me.Ordner.HyperlinkAddress = "c:\test\"

-Tom.
Microsoft Access MVP
 
U

Uhl

That still does not work. I did find out that when I delete the last
caracter, which is the backslah it does work. But when I leave out the
backslah in the code I have to delete the last character of the field
and type it back in.
Any hints?
I would probably write:
Me.Ordner.HyperlinkAddress = "c:\test\"

-Tom.
Microsoft Access MVP

I use a hyperlinkfield called: "Ordner" and I have 2 buttons

1. The first one is to make a directory with a the information from a
field called Nachname. This works fine

2. The second one is to set the link to that directory into the
hyperlink field. I tried 2 different versions

When I copy it in with cut and paste it works. But when I copy it with
the code it looks fine, but when I click on the hyperlink it does not work.

code for 1.) [This works]
With CodeContextObject
MkDir "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
End With

code for 2.) [This works partly]
With CodeContextObject
.Ordner = "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname & "\"
End With

or [This works partly]

With CodeContextObject
.Ordner = "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
End With

Thanks
 
U

Uhl

I found the solution.

code for 2.)

With CodeContextObject
..Ordner = me.Nachname & "# C:\Users\Bernd\Desktop\Kiz\" & Me.Nachname & "\"
End With
That still does not work. I did find out that when I delete the last
caracter, which is the backslah it does work. But when I leave out the
backslah in the code I have to delete the last character of the field
and type it back in.
Any hints?
I would probably write:
Me.Ordner.HyperlinkAddress = "c:\test\"

-Tom.
Microsoft Access MVP

I use a hyperlinkfield called: "Ordner" and I have 2 buttons

1. The first one is to make a directory with a the information from a
field called Nachname. This works fine

2. The second one is to set the link to that directory into the
hyperlink field. I tried 2 different versions

When I copy it in with cut and paste it works. But when I copy it
with the code it looks fine, but when I click on the hyperlink it
does not work.

code for 1.) [This works]
With CodeContextObject
MkDir "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
End With

code for 2.) [This works partly]
With CodeContextObject
.Ordner = "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
& "\"
End With

or [This works partly]

With CodeContextObject
.Ordner = "C:\Users\Bernd\Desktop\Kiz\Kunden\2Schwung\" & Me.Nachname
End With

Thanks
 

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