Open a specific record (not filter)

SueBK

Registered User.
Local time
Tomorrow, 00:23
Joined
Apr 2, 2009
Messages
197
I have a database that produces a variety of reports stashed in a variety of tables. I also have a table in which I record standard email messages to accompany particular reports.

On one of my forms for a specific report I'd like to put a command button that opens frmEmail to [EmailID] = 8. That is - I want the same record every time; it's not in any way linked to the form that I'm on. (At present, I exit the current form; open frmEmail; scroll through the records to the appropriate email message.)

I'm thinking that this has to be one of the simplest bits of code going, but I can not get it to work. I've tried:

DoCmd.OpenForm "frmEmails", acNormal, "", [EmailID] = "8", , acNormal
 
Just to clarify, because the more I search on Google the less I find. I always want to open to [EmailID] = 8. I'm almost at the point of creating a 2nd form with a filter set to "8"; but I'm sure this is so basic it should be able to be done with code.
 
If you are wanting to got to a specific record and not filter your Record Source, have a look at the FindRecord method
 
Thank you. Wasn't really sure I understood what the link was telling me.
"expression Required. An expression that returns one of the objects in the Applies To list." has me a little befuddled.

However, I'm using:
DoCmd.OpenForm "frmEmails", acNormal, "", "", , acNormal
DoCmd.FindRecord "6. Handover Report", acEntire, , acDown

Where "6. Handover Report" is the text in the first field on the form for the record that I want. It works, so I'm happy.

Thank you.
 

Users who are viewing this thread

Back
Top Bottom