Current Records Query

utvolsfan

Registered User.
Local time
Today, 03:12
Joined
Jan 8, 2003
Messages
20
Hello!

I am running a macro that pulls info from a query. This macro is excuted by a user pressing a button on a form. I want to only return the current record that the user is on when he/she presses the button. I tried using date fields, but that will not work because they may enter more that one record on any given day and the macro sends out an email notification. I don't want the email to show records that have already been sent. Is this at all possible?! Please help if you can! :)

Karen Jones
 
Thank you for responding. I am not sure what you mean. The control button that they use is called "notify agilent". I mean that is the button that they see on the form. When they push that button, it starts a macro that runs the query and sends the results in an email to agilent. Are you asking me if I can add notify agilent as a field in the query?

Karen




Rob.Mills said:
Can you run the query based on the id field?
 
Well you said you're trying to use dates but that there could be multiple records with the same date.

If you have a unique ID in these records you could use that and then you would know you're only going to get that one record.

How are you sending an email through a macro out of curiousity?
 
Well, this is for our engineering group. They put a date in the date field that they actually begin the order. I tried to use that date, but could not because they may enter 4 records that morning and then later in the day, they may need to enter more records and I do not want those first 4 records to be sent again.

I have the macro set up to run the report, which of course is based from the query. On the actual macro design screen I chose send object, then under that I chose msg box. Then in the to column at the bottom of the page, I put in emal addresses that I want the report sent to. Does that make sense?

I am soooo frustrated with trying to choose the current record only. Any help would be greatly appreciated.

Karen
 
You'll need to setup a unique id in this table in you haven't already. Just add an autonumber field and set this to the primary key. It will generate a number for each record.

Then in your form create a textbox with this field. Open the report like this:

In the Where part of the macro type:

[UniqueID field]=Forms![FormName]![UniqueID field]
 
I do have a unique identifier record counter already set up as the primary key. I also have a text box set up in the form. I do not have a "where" in my macro, or I don't know where to look for it.
 

Users who are viewing this thread

Back
Top Bottom