0

I want to generate a URL based on 2 fields in an access database.

I can get it to work with one variable, but have tried a number of iterations to get the second one to work properly.

the onclick VBA that I am using is:

Private Sub GenerateLink_Click()
Dim Filename As String
Dim Filedir As String

Filename = "https://hiddenforsecurity.com&password_encrypted=true&patient_last_name= '   
& [patient last name]' &patient_id=' & [casenumber]'"
RetVal = Shell("C:\Program Files (x86)\Internet Explorer\iexplore.exe " & Filename, 1)

End Sub

I can get the first part to work when I do this:

Filename = "https://hiddenforsecurity.com&password_encrypted=true&patient_last_name="   
& [patient last name]

But for the life of me I cannot figure out how to get the rest of it to work. I need to append the &patient_id= [casenumber] to also be apart of the link.

thanks in advance for any assistance.

4

2 回答 2

1

You put everything in double quotes there. You need to break the double quotes to stop the string while you concatenate.

Filename = "https://hiddenforsecurity.com&password_encrypted=true&patient_last_name=" & [patient last name] & "patient_id=" & [casenumber]

I'm not sure what patient_id is referencing though, if it is in a form you need me.patient_id. You probably know that though.

于 2013-08-15T12:42:17.867 回答
0

Try this out:

    Filename = "https://hiddenforsecurity.com&password_encrypted=true&patient_last_name=" & [patient last name] & "patient_id=" & [casenumber]
于 2013-08-15T13:06:31.477 回答