corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Access 2010 Web Database


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Access 2010 Web Database
Neo
Member

Registered: 20th Feb 07
Location: Essex
User status: Offline
4th Oct 11 at 08:43   View User's Profile U2U Member Reply With Quote

Guy doing a project for a site has gone off on long term sick so I've decided to have a look and get my old access hat on, not touched it since 2003 so a lot has changed.

Apparently it can send emails using the new function "sendemail" which goes in a data macro in a table. The data macro is then run from a standard macro on button press/update etc

I've tried setting the data macro and at present I have

Look Up a Record In Users
Where Condition =[Issues].[Status]=[Users].[UserLevel] AND [Issues].[Depart_Name]=[Users].[Dep_Name]
Alias
SendEmail
To=[Users].[Email]
CC
BCC
etc
etc


However I get errors saying that the values haven't been set as parameters

So I create 4 Parameters

IssuesStatus
UserUserLevel
IssuesDepart_Name
UserDep_Name

Use these in place of the table & field names then define the parameters with the RunDataMacro action on my button.

I then Recieved an Error saying "[Users] does not exist"

The "To" field must refer to a field in a table from which the WHERE condition is obviously selecting the correct row.

Anything I'm missing ?
pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
4th Oct 11 at 09:49   View Garage View User's Profile U2U Member Reply With Quote

Urgh it's god awful. Is it populating the To: field properly?
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
4th Oct 11 at 10:05   View Garage View User's Profile U2U Member Reply With Quote

Either a row isn't being returned or the list of fields in the query doesn't contain To.

Echo the var and see what's in it instead of trying to send the mail.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
4th Oct 11 at 10:43   View Garage View User's Profile U2U Member Reply With Quote

Although that error also looks like the table doesn't exist. Can you get any data out of it?

I would generally always echo the data coming back so I know what I have before passing it about. And run the query direct in to the DB so you can see how many rows come back.

Or do a COUNT(*) somewhere in there - not sure about the Access syntax - to see how many rows come back.

Or do a LIMIT 1 or DISTINCT or TOP 1 whatever it uses to make sure you only ever return one row. There doesn't appear to be anything in that query that will enforce uniqueness over the lifespan of the data. Unless it's doing some loopy stuff somewhere I can't see. Either way, it shouldn't really automatically send lots of email, aside from the spamming issue if that is waiting for the query to complete and there's a network element to the iteration that will slow the app down unacceptably.
Neo
Member

Registered: 20th Feb 07
Location: Essex
User status: Offline
4th Oct 11 at 10:51   View User's Profile U2U Member Reply With Quote

Echo gives me exactly what I'm expecting to see, its as if the SendEmail function cannot see the Users Table even though the Data Macro itself is in the users table.

Regarding uniqueness, its going to be maintained, the user table contains a list of SMT and HODS, so there will only ever be one person in department "Maintenance" with a user level of "2".

This access 2010 is not nice !

I think I have just twigged something, the data macro is stored in the users table, I wonder if when it runs the send email function its looking for a field called [users] rather than [email]

Currently stuck trying to work out why a query he's put attached to a field isn't running. Reminds me of a heated discussion me and Paul J had about people not commenting or documenting what they are doing
Neo
Member

Registered: 20th Feb 07
Location: Essex
User status: Offline
5th Oct 11 at 10:47   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Neo
if when it runs the send email function its looking for a field called [users] rather than [email]



This Working now
pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
5th Oct 11 at 11:10   View Garage View User's Profile U2U Member Reply With Quote

Silly boy :hugs:
Neo
Member

Registered: 20th Feb 07
Location: Essex
User status: Offline
5th Oct 11 at 11:47   View User's Profile U2U Member Reply With Quote


 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Data Access Pages ricKA Geek Day 0 1113
25th Mar 04 at 16:07
by ricKA
 
help with Excel Macro Fonz Geek Day 2 323
10th Jun 09 at 11:45
by Fonz
 
Given the tast to build a database Jas Geek Day 17 706
5th Aug 10 at 15:42
by Bart
 
Building some workshop software/website. Dan Geek Day 30 2174
17th Jul 11 at 17:20
by Dan
 
Sharepoint 2010 User Profiles / Access 2010 Web DB Neo Geek Day 4 601
16th Sep 11 at 20:57
by Neo
 

Corsa Sport » Message Board » Off Day » Geek Day » Access 2010 Web Database 29 database queries in 0.0116720 seconds