473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

"OrderID=" & Me.OrderID not working

2
I am working with Microsoft access 2003
i have a continuous form which shows summary date for purchase orders. This form is based on a query which looks at the Purchase Orders table and the Purchase Orders detail table
One of the fields in this contiuous form is the Order ID. When a user clicks on the order ID, i want them to see the full details for that order ID, based onthe "purchaseOrdersView" form
I have the following code

Expand|Select|Wrap|Line Numbers
  1. Private Sub OrderID_DblClick(Cancel As Integer)
  2. On Error GoTo Errorhandling
  3.  
  4.     DoCmd.OpenForm "PurchOrdersView", , , "OrderID=" & Me.OrderID
  5.  
  6.  
  7. GetOut:
  8.     Exit Sub
  9. Errorhandling:
  10.     strMsg = "Error No. " & Err.Number & vbCrLf & "in Object: " & _
  11.     Me.Name & vbCrLf & "Sub: OrderID_DblClick" & vbCrLf & vbCrLf
  12.     MsgBox strMsg & "Standard Description: " & vbCrLf & Err.Description
  13.     Resume GetOut
  14. End Sub


However, when i click on OrderID, i am taken to the last record, not to the one i have clicked on....any thoughts
Mar 25 '07 #1
4 2727
Denburt
1,356 Expert 1GB
It looks o.k. but I would use the following syntax:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "PurchOrdersView", , , "OrderID=" & Me!OrderID
Mar 25 '07 #2
missinglinq
3,532 Expert 2GB
Is OrderID text or numerical? If text then

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "PurchOrdersView", , , "OrderID=" & Me.OrderID
should be

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "PurchOrdersView", , , "[OrderID]='" & Me.OrderID & "'" 
Mar 25 '07 #3
awcem
2
Is OrderID text or numerical? If text then

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "PurchOrdersView", , , "OrderID=" & Me.OrderID
should be

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "PurchOrdersView", , , "[OrderID]='" & Me.OrderID & "'" 
orderID is numerical - i tried your suggestion just in case but i get error message 205...any other ideas ? i am not really a programmer as you can probably tell so really stuck on this
Mar 25 '07 #4
NeoPa
32,556 Expert Mod 16PB
Is the control on the form called [OrderID] too? I suppose the field in the record is called [OrderID].
If they are both named the same then try to Debug.Print to show what's in it before the call.
Mar 27 '07 #5

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

Similar topics

1
by: Westcoast Sheri | last post by:
When "register globals" is set to "on," has anyone noticed if PHP Version 5 affects the usage of "isset" or not? For example, in a webpage form, should the following code: if...
0
by: Steve | last post by:
Hi, Is there something fundamentally wrong with the following query? SELECT MAX(OrderID) AS Expr1 FROM Orders WHERE (MarketActionCode = 'S') AND (OrderLegCode = 'S') AND (Status = 'F') AND...
1
by: DonLi | last post by:
OK. For DDL, please refer to the classical Northwind ORDERS table, problem/challenge, find the longest duration (start_date and end_date), during which, no orders were placed. FYI, column names...
2
by: MLH | last post by:
I copied the following code right out of MS Access 2.0 HELP under Index Property Setting example... Sub Button0_Click () Dim MyDB As Database, MyTable As Recordset Set MyDB =...
0
by: web1110 | last post by:
Hi y'all, I was playing with the NorthWind database, displaying subtables in a DataGrid. It worked fine for 3 levels, but when I added a fourth, I got the following error: These columns...
4
by: Chad Micheal Lawson via .NET 247 | last post by:
I'm stumped at this point and I'm tired of trying things so I'mposting in hopes of some guru with a sharp eye. I have anasp.net app running on a local Win XP Pro box. Within the app,I call a SPROC...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
1
by: Rob | last post by:
The code below is almost there (it does change the value for EVERY ORDER).... I simply want to be able to change the value of the Delivered Tag to Yes. BUT ONLY if the Order is equal to 123456 ? ...
17
by: pbd22 | last post by:
Hi. How does one return a range of rows. I know that "Top 5" will return rows 0 - 5 but, how do I get 6 - 10? thanks
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.