user1794656
user1794656

Reputation:

Generate URL in MS Access with 2 field variables

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.

Upvotes: 0

Views: 1279

Answers (2)

Grant
Grant

Reputation: 903

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.

Upvotes: 1

Mardin Yadegar
Mardin Yadegar

Reputation: 437

Try this out:

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

Upvotes: 0

Related Questions