I have a form where I enter in either Contact or business details, I can then add multiple email addresses to contact or business by updating a table with the additional email addresses and using the contact or business 'ID' of the record to associate them to email. (I hope I explained that okay!)
This all works fine, I now want to add a 'pop-up' window to show the various email addresses associated to contact or business.
I've set up my pop-up form with a list box, assigned a query to the list box (showing email address Column1 and ID in Column2). This now show's every record.
I try to open the popup window from the form using the ID in a 'where condition' to try and filter the listbox results and its not working? below is the code I'm playing with!
Code on the button I click to open the 'pop-up'
You'll have to forgive my Naming! in the above code I've tried to reference the listbox (List_Add_Email_Bus) in the form 'frm_List_Add_Emails_Bus'.
This all works fine, I now want to add a 'pop-up' window to show the various email addresses associated to contact or business.
I've set up my pop-up form with a list box, assigned a query to the list box (showing email address Column1 and ID in Column2). This now show's every record.
I try to open the popup window from the form using the ID in a 'where condition' to try and filter the listbox results and its not working? below is the code I'm playing with!
Code on the button I click to open the 'pop-up'
Code:
Private Sub cmd_find_AddEmail_Click()
Dim strWhere As Variant
strWhere = Null
strWhere = "Me.List_Add_Email_Bus.[AE_BusinessID] = " & [B_ID] & ""
DoCmd.OpenForm "frm_List_Add_Emails_Bus", WhereCondition:=strWhere
Forms.frm_List_Add_Emails_Bus.SetFocus
End Sub
You'll have to forgive my Naming! in the above code I've tried to reference the listbox (List_Add_Email_Bus) in the form 'frm_List_Add_Emails_Bus'.