ME statment HElp

H

hope

Hi
I hope I can explain this all ok

I have on a form "frmCustomers" a command button on the [event procedure]
I have
Dim x
x = fHandleFile("mailto:" & Me!ContactEMail, WIN_NORMAL)

The record source on the form comes from a table called Customers
Which works fine

BUT what I want to do is make another form where the record source comes from a table
callled tblEmail

So if I make a command button with the [event procedure]

Dim x
x = fHandleFile("mailto:" & Me!ContactEMail, WIN_NORMAL)


IT will go and look in the table "Customers" for some reason

What I want is

go and look in the "tblEmail table and get the info from the "ContactEMail" field


How do I alter this please

As always, any and all help is greatly appreciated.

Thank you in advance.

John
 
N

Nikos Yannacopoulos

John,

The Me! keyword can be thought of a short for "This Form" in a form's
module. Your code does not look up the mail address in any table, it picks
it up form the curent value of the ContactEMail control on your form. So, to
pick up a mail address from a different table using the same code structure,
you would need to have the form's rowsource be (or contain) the other table,
and the control's source be the particular field. Alternatively, if the two
tables are joint on a Contact_ID field, for instance, you could leace your
form as is, and use the Contact_ID control on your form to DLookup the mail
address from the other table in your code.

HTH,
Nikos
 

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