VBA code to email link to the other database

aman

Registered User.
Local time
Today, 03:17
Joined
Oct 16, 2008
Messages
1,251
Hi All

In my project, When the Supervisor enters all the details in the form and click 'Send' button then a link gets sent to the Staff member email address which when clicked will open up another database and that database has a listbox which will show staff members pending activities that he needs to be completed.

My code works fine if I send link to the accdb file in the email. ALl the pending activities get displayed in the listbox of that staff member.

but if I create a accde file and the email gets sent with the link to the accde file which when opened doesn't display anything in the listbox.

ANy ideas why its happening?

Thanks .
 
I think we need to know a bit more about these databases (plural) that you have named and their relationship to each other. From your description, we cannot tell enough to know what exactly is going on.
 
There should be no difference in de vs db.
Is there vb code involved in this combo?
 
The_Doc_Man, I have Access database named "Test" . In a form , the supervisor enters all the details and click 'Send' button then a link to the other database named "Agent_database" gets sent to the Agent.
Code:
Public Sub SendEmail()
    
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)
    Dim myLink As String
    myLink = "L:\AgentDB.Accdb"
    With MailOutLook
    
   
     .To = DLookup("[Email]", "tblStaff", "[strUser]='" & NameofUser() & "'")
       
       .Subject = FName & " needs to be signed off"
       .HTMLBody = FName & " has been completed by " & DLookup("[Staff Name]", "tblstaff", "struser='" & NameofUser() & "'") & "." & vbCrLf & vbCrLf & "The Reference number is " & gRef & ". " & vbNewLine & vbNewLine & "Please click on this link to review and signoff: <a href='" & myLink & "'>Click me</a>."  
     
    .sEnd
    End With
End Sub
When the Agent receives the email and click the link the Agent database gets opened up and the listbox displays all its pending activities to be completed.

But if I make accde of Agent database and amend the vba code so that link to accde file gets sent instead . So when the Agent receives link to accde and open it then the listbox on agent database displays nothing in it.

I hope I made it clear. Please let me know if anything is unclear.

thanks
 
And also one more thing is happening if I change from accdb link to accde link.

The following code displays the name of the user in the heading section of the form in Agent database when accdb link is clicked.

But when accde link is clicked then nothing gets displayed in the heading section. :(
Code:
Me.txthidden = DLookup("[Staff Number]", "tblstaff", "struser='" & NameofUser() & "'")
 
Guys, has anyone else faced the same issue? Can anyone please help me in this?

Thanks
 

Users who are viewing this thread

Back
Top Bottom