set field problem

  • Thread starter Thread starter Uhl
  • Start date Start date
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
 
I would probably write:
Me.Ordner.HyperlinkAddress = "c:\test\"

-Tom.
Microsoft Access MVP
 
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
 
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
 
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
 
Back
Top