Double-click a record on a list to open another Form (1 Viewer)

Qatgirl

New member
Local time
Today, 02:25
Joined
Dec 10, 2008
Messages
2
Hi! I'm new, both to this forum and Access 2007. I am making repairs and changes to an ages-old database (which has already been updated to version 2007).

Here's my situation:
I have a form which displays a list of records pertaining to a specific customer.

I want to click (double-click, whatever) -- either on a record, or on a button which appears on each record line.

This will open another form, showing more data specific to the clicked-on record.

On this forum, I found a post titled, "Click on list item and open a detail form" from 07-31-2007. (Can I paste a link to this post? http://www.access-programmers.co.uk/forums/showthread.php?t=132925&highlight=click+list)

I think this is exactly the solution I need. However...

The answerer provides this code:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEditRes"
stLinkCriteria = "res_num=" & Me.res_num

DoCmd.OpenForm stDocName, , , stLinkCriteria​
I changed "frmEditRes" to "Quote Infor"... the name of the form I want to open.

I changed "res_num" to "Quote #"... the lookup field.

I get: "Compile error: Expected: end of statement"

Can anyone steer me in the right direction? From the list of quotes, I want to open a form showing only one quote.

Thanks!
 

dkinley

Access Hack by Choice
Local time
Today, 04:25
Joined
Jul 29, 2008
Messages
2,016
Welcome to the forums!!!!

That should work for you. I would suspect that your statment ...

I changed "res_num" to "Quote #"... the lookup field.

is the problem. The usage of # is reserved for referencing date fields. I personally use QuoteNum (so it is not confused with a yes/no if I was to call it QuoteNo meaning 'Is there a quote?').

You can try putting brackets around it to see if that will fly: [Quote #]. Brackets can be used to help when people put spaces in their field names.

Hope that helps...
-dK

Edit: Here are some links that may help moving forward in terms of naming conventions and reserved words ...
http://www.mvps.org/access/general/gen0012.htm
http://www.allenbrowne.com/AppIssueBadWord.html
 

missinglinq

AWF VIP
Local time
Today, 05:25
Joined
Jun 20, 2003
Messages
6,423
I have the same take as dk! The pound sign is used as a delimiter to designate dates, and Access always expects to see them in pairs.
 

dkinley

Access Hack by Choice
Local time
Today, 04:25
Joined
Jul 29, 2008
Messages
2,016
You betcha ... glad I got something right on the first go. =]

-dK
 

Cosmo Monkey

New member
Local time
Today, 02:25
Joined
May 3, 2013
Messages
1
Yes, Dinkley...Thank you. I used the coding you supplied to solve my problem. Works like a charm, except I get a Enter Parameter Value popup that if I enter the contents of the field it opens up the form with the information I need to edit. Any thing comes to mind that this monkey did wrong.

Cosmo
Nothing is fool proof, as we fools are so ingenius.
 

Users who are viewing this thread

Top Bottom