Translate from SQLView to RunSQL statement?

eforce

Registered User.
Local time
Today, 12:50
Joined
Mar 25, 2002
Messages
44
Can anyone tell me how to use the "DoCmd.SQLRun" statement with this SQLView statement. I've searched through help as well as this forum. When I thought the answer was coming while reading through a thread; the poster said never mind he/she figured it out (I hate when that happens) (SMILE)

UPDATE tblMacomUMTSec LEFT JOIN tblUMTMemberInfo ON tblMacomUMTSec.MACOM = tblUMTMemberInfo.MACOM SET tblUMTMemberInfo.MACOMSECNAME = [tblMACOMUMTSEC].[MACOMSECNAME], tblUMTMemberInfo.MACOMPHONE = [tblMACOMUMTSEC].[macomphone]
WHERE (((tblUMTMemberInfo.[DUTY POSITION])="MACOM UMT SECRETARY"));

I know I would need to take out the paranthesis. Also is there anything that I have to declare in the Sub.

Thanks

Eforce
 
eforce,

Dim dbs As DataBase
Dim sql As String

Set dbs = CurrentDb

sql = "..."
dbs.Execute(sql)

BUT ... bear in mind that you get no feedback.

You could update 0 or a million records and won't
know it.

Wayne
 
Thanks Wayne,

what I did was create a macro using the RunSQL command and then I converted it into a module, then I copy the code to the close event of my pop-up form


Eforce
 

Users who are viewing this thread

Back
Top Bottom