neglecting apostrophe in name from combo ?

  • Thread starter יריב החביב
  • Start date
×

יריב החביב

Hello,

way is'nt it work ?

Dim lettername As String
rs.FindFirst "[lettername] = " & Chr$(34) & Me![Combo36] & Chr$(34)
Application.FollowHyperlink "c:\lettername.doc"

the name (lettername) still have apostrophe

thank's

תודה רבה
 
K

Ken Sheridan

Are you trying to open a Word file whose name is selected from the combo box?
If so then you don't need to navigate to the row in a recordset; simply
concatenate the file name into the string expression:

Dim lettername As String

lettername = Me.Combo36
Application.FollowHyperlink "c:\" & lettername & ".doc"

Does the combo box include the path to each file, e.g.
Users\MyName\Documents\Letters\MyLetter, as otherwise the above would mean
the file is in the root folder of the local C drive, which would be unusual.

Ken Sheridan
Stafford, England
 
×

יריב החביב

thank you brother
--
תודה רבה


Ken Sheridan said:
Are you trying to open a Word file whose name is selected from the combo box?
If so then you don't need to navigate to the row in a recordset; simply
concatenate the file name into the string expression:

Dim lettername As String

lettername = Me.Combo36
Application.FollowHyperlink "c:\" & lettername & ".doc"

Does the combo box include the path to each file, e.g.
Users\MyName\Documents\Letters\MyLetter, as otherwise the above would mean
the file is in the root folder of the local C drive, which would be unusual.

Ken Sheridan
Stafford, England

יריב החביב said:
Hello,

way is'nt it work ?

Dim lettername As String
rs.FindFirst "[lettername] = " & Chr$(34) & Me![Combo36] & Chr$(34)
Application.FollowHyperlink "c:\lettername.doc"

the name (lettername) still have apostrophe

thank's

תודה רבה
 
Top