473,385 Members | 1,813 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,385 software developers and data experts.

How to View the Selected Order on a Form

angus macgyver
This thread was a continuation of form not updating table--changing the control source of a field. The database in question is discussed there and the latest attached version can be found at customers.zip.

The problems I have are:
  1. Viewing an order using the view order button in the form formorderslist.
  2. Listing the orders in the form formorderslist by order date.

Any ideas would be greatly appreciated as always! I think these 2 issues solved would result in an easy to use database don't you?

Fred.
Nov 18 '10 #1
3 1526
NeoPa
32,556 Expert Mod 16PB
Let's see if we can throw some more points at you.
  1. It's never a good idea to identify a record by its name. You already have the associated ID. Use that to filter [FormOrdersList]. If you don't already have it as a hidden column in the relevant ComboBox then update it to include that and use it in the WhereCondition parameter of the OpenForm() call.
  2. Your code for bvieworder_Click() is :
    Expand|Select|Wrap|Line Numbers
    1. Private Sub bvieworder_Click()
    2. On Error GoTo Err_bvieworder_Click
    3.  
    4.     Dim stDocName As String
    5.     Dim stLinkCriteria As String
    6.  
    7.     If IsNull(Me!orderid) Then
    8.         MsgBox ("Choose another order")
    9.         GoTo Exit_bvieworder_Click
    10.     End If
    11.  
    12.  
    13.     stDocName = "formorder"
    14.  
    15.     stLinkCriteria = "[orderid]=" & "'" & Me![orderid] & "'"
    16.     DoCmd.OpenForm stDocName, , , stLinkCriteria
    17.  
    18. Exit_bvieworder_Click:
    19.     Exit Sub
    20.  
    21. Err_bvieworder_Click:
    22.     MsgBox Err.Description
    23.     Resume Exit_bvieworder_Click
    24.  
    25. End Sub
    [OrderID] is a numerical value so the quotes in line #15 are causing a problem. Try instead :
    Expand|Select|Wrap|Line Numbers
    1.     stLinkCriteria = "([orderid]=" & Me.orderid & ")"
    Parentheses aren't absolutely required but they can help to avoid confusion.
  3. To sort the orders by date simply enter [OrderDate] into the form's Order By property.

Let us know how you get on with these :-)
Nov 22 '10 #2
NeoPa,
you've done it again. thank you for so clearly providing solutions to the problems presented heretofore!
#s 2 and 3 solved the biggest issues. now i can choose a specific event on the continuous form and the events of said form are sorted in order! i am unsure where suggestion #1 fits in but i will look into it....

the database finally seems workable! alas a few issues remain (albeit minor ones) which i believe will warrant a new thread. the saga continues....
Nov 23 '10 #3
NeoPa
32,556 Expert Mod 16PB
Yes, a new thread is always a good idea (but feel free to link me to it from here if you like).

Having two (even small) questions in a single thread can cause issues. I found the thread deleted at one stage as an admin deleted it for a poor title - that I'd set up!

Finding a suitable title to cover two different questions wasn't easy, but I put something together eventually. Anyway, 1 question 1 thread will ensure it's all much more straightforward in future. It also means that a single post can be selected as the Best Answer when the question has been satisfactorily answered.
Nov 23 '10 #4

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

Similar topics

3
by: Daniel Ruscoe | last post by:
Hi chaps, I'm relatively new to the language, but I want to create a simple order form using PHP and cookies. Please let me know if there's a better way in this situation, database isn't...
0
by: Peter Royle | last post by:
I am working with VB.NET. It has just started losing my design view of a form when I open a project. If the design view was open when I last closed it, the view is there, but the Solution Explorer...
0
by: Balu Ramachandran | last post by:
How can I create the Thumbnail view from the form? In the following approach I tried but Iams facing some limitations to get the thumbnail image of the form alone. Plaese any one can help in...
4
by: Lisa Jones | last post by:
Hi Can someone tell me How do you get selected date form MonthCalendar control Thanks so muc Lisa
1
by: Joey Mok | last post by:
Hi, How to create a Sales Order form with ASP.NET 2.0? I want to save the sales order header and its items at the same time. Can I make this web form with ASP.NET 2.0 new Data Controls? ...
4
by: papawilley | last post by:
How do I right JavaScript, quantity calculations for an existing online order form. I am trying to make an order form that will have a open price, added to a set price selected from a drop down box,...
0
by: ravindarjobs | last post by:
hello friends, i am using ms access 2003, vb6. i have created a form in pivot table view. i have placed this form in other form as sub form. in the second form, i have a button. when i click...
6
by: Palehorse | last post by:
I'd like to apologize upfront for me saying "I'm not a programer", I'm sure you all hear this a hundred times a day. Unfortunately, in this case, it's true. I've been working on trying to figure out...
1
by: Bongani Mgibi | last post by:
What code must I use if I want to create an order form on my website where patrons can order and/or request multiple products and/or services from the price list with different pricing, the order...
14
by: eneyardi | last post by:
I can't see the layout view of the form anymore, i tried to look-up the report format but the allow layout view is selected as yes. But the Design and Print view of the report are available. Anyone...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.