Reference to field in different table

A

Antonio

Hello, everyone.

I am trying to "capture" the field on another table based on a combobox
selection.

Let me be clear on this: I have a CustomerDB table and a tblURLs table. On
the main form, I have a combobox which gets the data from tblURLs table.
This table has a Title and URL fields.

I am trying to capture the URL field into an e-mail to send to customers.

Example: Customer subscribes to "Title" and that is captured easily in the
e-mail, since it is a field that's on the form from which the e-mail is
generated. I would like to append the URL for "Title" below the title's
name but I am not sure how to display the URL
 
G

Guest

If the URL is in the combo as well as the title then get at it by
Combo.Column(1)
or use DLookUp("URL","tblURLs","Title = '" & Me.Title & "'") or
DLookUp("URL","tblURLs","Title = '" & Combo & "'")
whichever is applicable the best
 
A

Antonio

Yes, I did. Thank you for your help. Sometimes I just blank out on the
simplest things. Thank you again...:)
 
G

Guest

Not sure I understand that question.
If your combo box is called cmbTitles for example and in it is
Title1 URL1
Title2 URL2
etc
then cmbTitles.Column(1) will bring back URL1 if Title1 is selcted in the
combo and URL2 if Title2 is selected etc.
If your combo only contains the list of titles, then you need to use the
DLookUp function DLookUp("URL","tblURLs","Title = '" & cmbTitles & "'")
 
A

Antonio

I set the Column property of the comboboxes to include all the columns in
the URL table, then I used the combobox.columns(2) to specify the value in
the URL column in the table.

Thank you for your help. It works just great!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top