megatronixs
Registered User.
- Local time
- Today, 23:40
- Joined
- Aug 17, 2012
- Messages
- 719
Hi al,
I created a database that keeps all emails stored. The form looks pretty much as outlook to make things logical. In the form I have 2 listboxes that act as the folders and subjects of the emails and then I have the reading pane. The first listbox shows all the folder there are, When I select a folder, all the emails that it contain show up in the second listbox. When I select a subject from an email, it will show the data inside the "reading pane" in the form (based on the ID nr that the email has). When I click on the email and it shows up, all the subjects from the second listbox disappear. How can I change the below code so that it will not happen? Any help to solve this mystery would be appreciated.
Greetings.
I created a database that keeps all emails stored. The form looks pretty much as outlook to make things logical. In the form I have 2 listboxes that act as the folders and subjects of the emails and then I have the reading pane. The first listbox shows all the folder there are, When I select a folder, all the emails that it contain show up in the second listbox. When I select a subject from an email, it will show the data inside the "reading pane" in the form (based on the ID nr that the email has). When I click on the email and it shows up, all the subjects from the second listbox disappear. How can I change the below code so that it will not happen? Any help to solve this mystery would be appreciated.
Greetings.
Code:
Option Compare Database
Option Explicit
Private Sub Command24_Click()
Application.FollowHyperlink [MailLink]
End Sub
Private Sub List28_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frml_eMail_Archive"
stLinkCriteria = "[ID]=" & Me!
[List28]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Private Sub ListFolders_AfterUpdate()
On Error Resume Next
List28.RowSource = "Select tbl_eMail_Archive.ID, tbl_eMail_Archive.Subject " & _
"FROM tbl_eMail_Archive" & _
" WHERE tbl_eMail_Archive.FolderName = '" & ListFolders.Value & "' " & _
"ORDER BY tbl_eMail_Archive.ID;"
End Sub
Private Sub Form_Current()
On Error Resume Next
' Synchronise country combo with existing city
ListFolders = DLookup("[FolderName]", "tbl_eMail_Archive", "[Subject]='" & List28.Value & "'")
' Synchronise city combo with existing city
List28.RowSource = "Select tbl_eMail_Archive.ID, Select tbl_eMail_Archive.ID " & _
"FROM tbl_eMail_Archive " & _
" WHERE tbl_eMail_Archive.FolderName = '" & ListFolders.Value & "' " & _
"ORDER BY tbl_eMail_Archive.ID;"
End Sub