Solved

How open form to specific record

Posted on 2011-02-25
3
273 Views
Last Modified: 2013-11-05
I want to open a form to a specific record from an onclick event in a command button.  Here is my syntax but it doesn't work,  Can someone help?

docmd.openform "frmIncidentDataNEW",,,"[RecN]='" & me.cboSelectRecord &"'"

Note:  RecN is a number.

--Steve
0
Comment
Question by:SteveL13
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
VTKegan earned 500 total points
ID: 34979299
If RecN is a number you need


DoCmd.OpenForm "frmIncidentDataNEW",,,"[RecN]=" & Me.cboSelectRecord
0
 
LVL 10

Expert Comment

by:VTKegan
ID: 34979308
You should only apply the ""s aroung the criteria if RecN is a string (Text)

0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 34979362
if the bound column of the combo is not the RecN, you have to specify the column no

DoCmd.OpenForm "frmIncidentDataNEW",,,"[RecN]=" & Me.cboSelectRecord.column(1)
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now