SendMail Question for BukHix

Here is the structure for the employee table "tblEmployee". Wayne - I think I was able to see through the clouds a little but and I don't think that I will be able link the tblAddressBook table to the employee table. THis is because there is no employee ID field in the text file and, thus, no way to relate it to a specific employee in the db.

Instead of trying to make the files relational to the employee ID, I think this will work just was fine as a stand-alone lookup table because I wanted to use this table as the recordsources for a combo box anyway so I don't have to manually enter in all of the email addresses so...

either solution will be great!~

Thanks
Kev
 

Attachments

Kevin,

Here is an A2000 version. I can't fully test it without
tblEmployee. But it should get us there.

Wayne
 

Attachments

Kevin,

Two changes:

First add one more of these -

strBuf = Mid(strBuf, InStr(1, strBuf, ",") + 1, Len(strBuf))

I guess I can't count too well.

Second change this part
Code:
   ' Delete the next 9 lines ...
   ' Find Employee ...
   '
   ' EmployeeID = Nz(DLookup("[EmployeeID]", "tblEmployee", "[FullName] = '" & UserName & "'"), 0)
   ' If EmployeeID = 0 Then
   '   MsgBox ("No such employee: " & UserName)
   ' Else
      '
      ' We have the employee, do we have his address
      '
      sql = "Select * From tblAddressBook where UserName = '" & UserName & "';"
      Set rst = dbs.OpenRecordset(sql)
      If rst.EOF And rst.BOF Then
         rst.AddNew
         rst!UserName = UserName
         rst!EMailAddress = EMailAddress
         rst.Update
      Else
         rst.Edit
         rst!EMailAddress = EMailAddress
         rst.Update
      End If

hth,
Wayne
 
WAyne if I were you I wouldnt post any more threads..EVER...

reason: You're at a perfect 777 number of posts.

Talk about lucky sevens.

Jon
 
Ummm... Jon.... Ummmmm..... Asking Wayne not to post anymore is not going to help me get this resolved :D LOL!

Seriously though... Wayne - First of all thanks for taking the time to help on this - lots of effort on your part and I sincerely appreciate it.

Next:
OK - I'm getting a Complie Error: Method or data member not found on this line:

rst.edit

Doesn't like this for some reason - also when I tried to compile it doidn't like the fact that I now have two modules with OPENFILENAME functions - forgot to mention that I already have a module that has the OPENFILENAME function so having two made the compiler angry!:rolleyes:

Can I rename the OPENFILENAME in your module or do I need to just reference the other (although the code looks to be different) Dialog boxs are not a strong point for me...

Is it possiible for me to send you a copy of this db so you can have a look yourself? I would post it here but I can't get it to attach (although its really not that big)...

Thanks-Kev
 
You're using ADO arent you?

If so ADO does not have an .edit method.

Jon
 
I have the DAO 3.6 Object library referenced as well so I assuming that this would be alright...

Kev
 
Also regarding the OPENFILENAME.

You cannot define this more than once..since it is a type. Simply reference the other one even if the code is different. I assume you want the open / save dialog box? If its Open you need to call:

Code:
retval = GetOpenFileName

if it's save you need to call

Code:
retval = GetSaveFileName

Jon
 
Let me see some code...dont matter if you have DAO referenced.

Jon
 
Kevin,

Here's the final version, it works fine. You have to promote
the DAO reference.

Wayne
 

Attachments

THANK YOU!!!

Wayne - I appreciate the help on this and it works like a charm!

Take Care and thanks again,
Kev
 
Kevin,

Glad to help, I get a lot of data from unusual sources, so I have
to use code quite a bit.

Hope this makes life a bit easier for you.

Wayne
 
Kevin that should teach you not to put someone's name in a post again, eh? :D
 
LOL Buk! :D

I should have also said thanks to you and Jon as well...!

I appreciate ALL the help/time you guys put into trying to help me find a solution AND the help/time everyone on this forum puts into helping others build better business solutions....

Thanks Again,
kevin
 
WayneRyan said:
Kevin,

Glad to help, I get a lot of data from unusual sources, so I have
to use code quite a bit.

Hope this makes life a bit easier for you.

Wayne

I am constantly getting data thrown at me from oddball sources, too. Quite some time back, Buk gave me a macro for Excel that I still use to clean some mainframe FOCUS data prior to importing into Access. I recently had a problem come up similar to what you guys just worked out, but I used Excel as a 'middle' ground to clean the data and then let Access grab it and clean it further. I'm glad to see others have to wrestle with 'impossible' tasks and find a winning solution.
 
Friday,

Thanks for your comments. It's good to see that I'm not the
only one receiving data like that. I've had to import things
like s/w test procedures from Word Perfect and s/w Requirements
from MS Word.

See ya,
Wayne
 
I'm working on a crime mapping project right now and the data I got from one county sheriff was just hard copies of the data. Three years of crime reports ! I called and asked if they could get it for me in electronic format, and they didn't know what I meant. Apparently, they have a reporting system that they only know how to input data and print out reports, nothing else. If they weren't 600 miles away, I'd drive over there and help them out, but can you imagine trying to do that over the phone?
 

Users who are viewing this thread

Back
Top Bottom