By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 2,596 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Double click to open record performs no action

P: 13
I've been struggling several time with this problem and apparently its driving me a little crazy: i have this code

Expand|Select|Wrap|Line Numbers
  1. Private Sub CodeNumber_DblClick(Cancel As Integer)
  2. DoCmd.OpenForm "Products", , , _
  3.         "[products.codenumber]=" & "'" & Me.CodeNumber & "'"
  4.  
  5. End Sub
I cannot understand why on other forms this code works flawlessly and sometimes on others no. I have used this sort of code many other times on lots of other forms and worked properly but in this one, nope! The form automatically open on double click and where it is suppose to load the record, the form 'products' open itself with no loaded record.

What in the heck is wrong?

Update:

Further testing made: removed all code and enabled and unlocked some disabled fields from form Products, changed "'" with "", "#"

Tried this code as well

Expand|Select|Wrap|Line Numbers
  1. "[products.codenumber]=" & "'" & Forms![search_advancedstock]![search-advancedstock-datasheet]![CodeNumber] & "'"
and still nothing...
Jun 1 '12 #1
Share this Question
Share on Google+
4 Replies


dsatino
100+
P: 393
if the codenumber field is numeric, you have to remove the single quotes
Jun 1 '12 #2

P: 13
tried as well for trial purposes. didn't worked either. however the code number is composed of numeric and text so single quote is to be used
Jun 1 '12 #3

Rabbit
Expert Mod 10K+
P: 12,315
[products.codenumber] will only work if your field is actually named that. Which I doubt. You're either looking for [products].[codenumber] or just simply [codenumber].
Jun 1 '12 #4

P: 13
Thanks for your input rabbit. After spending hours trying to find the answer to the question, i finally found out that it was all fault of a statement in a query. Set a workaround on a new query and fixed the problem. Thanks all!
Jun 1 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.