473,471 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

select items

lee123
556 Contributor
is there a way to have a product form (that has items you can choose from) and a Orderdetail form to add the items to with a button to select these items and when selected add to the orderdetail form. anotherwords, if you have a product form with items in it you could highlight the items then click a save or select button and add the items you have selected in an orderdetail subform. because right now i am using a combo box with the items in it and it addes it to the orderdetail form but i want to be a little more advanced. you know.

lee123
Sep 9 '07 #1
16 2225
JKing
1,206 Recognized Expert Top Contributor
Have you thought about trying a list box instead of combo box so you can select multiple items?
Sep 10 '07 #2
lee123
556 Contributor
you know I haven't. But that sound cool. how would you go about doing that? Please explain.

lee123
Sep 10 '07 #3
JKing
1,206 Recognized Expert Top Contributor
It would be quite similar to using a combo box. A list box is much the same except you can select more than one value. There is an option within access to convert a combo box into a list box. Once you've made your combo box into a listbox set the multi-select property to extended.

In code you can iterate through the selected items by using the ItemsSelected collection.

This will print the data in the bound column for each selected row in the immediate window.
Expand|Select|Wrap|Line Numbers
  1. Dim varItem As Variant
  2.  
  3.     For Each varItem In Me.List4.ItemsSelected
  4.         Debug.Print Me.List4.ItemData(varItem)
  5.     Next
  6.  
Sep 10 '07 #4
lee123
556 Contributor
well I tried that but i still want to know if my first question is possible? can it be done? and if so how can i do it.

lee123
Sep 10 '07 #5
JKing
1,206 Recognized Expert Top Contributor
I guess I don't really understand what you are looking for.

From what I gathered from your first form you want a list of products. On click of a button you want them added to a seperate form as an order.

In what way do you plan on presenting the list of products? I suggested a listbox because it's simply that, a list.
Sep 11 '07 #6
lee123
556 Contributor
Ok lets see, well the list box takes up too much room for the items i have in the product form. . picture this, you have an order form. with a orderdetail subform in it the order form has your basic customer detail. like po #, orderdate, duedate, etc. in the subform(orderdetail) you have Qty, items(product), unitprice. etc. in the orderdetail form i have put a combo box. named it product combo (in the property box) with no controlsource and put this code behind it:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ProductCombo_AfterUpdate()
  2.  
  3. Docmd.GoToRecord, , acNewRec
  4. ProductID = Productcombo.Column(0)
  5. Description = ProductCombo.Column(1)
  6. UnitPrice = ProducCombo.Column(2)
  7.  
  8. End Sub
In the combo box i can drop it down and pick what ever i want and it goes in the orderdetail subform. but. ( here's My question) Instead of haveing a drop down box that i can pick from. i would like to just have a form (product form). that i can select (Highlight) the items and have a button in the (product form) that after you have selected them(items) click the button and saves the item in memory and when you get to the ( orderdetail) sub form drop them in with another button(Add) i guess that makes sense. if it can't be done then i'll live with the combo box i have now. thanks

Lee123
Sep 11 '07 #7
Denburt
1,356 Recognized Expert Top Contributor
From what I gather I would say to stay along the same lines of JK although in your order form you would use a button. Click the button and it would hide the order form and a products form shows up with the list of products. Select the products and click a button on that form it would then add those products to the orders form and problem solved.
Sep 12 '07 #8
NeoPa
32,556 Recognized Expert Moderator MVP
JKing,

I looked but didn't really understand the question. If I ever find the question is expressed clearly then I will return.
Sorry I couldn't help.
Sep 12 '07 #9
lee123
556 Contributor
one more time. this is getting frustrating. ok look i have four forms ok. one form for the customer. one form for the order. and one form for the products and i have a form that is the orderdetail form, but i have made the orderdetail form a subform on the order form ok! Now in my orderdetail form i have a combo box that holds all the items from the product table so when i drop down the combo box it list everything in the product table. if i have anything that is not in the list i can add it to the combo box.

(Question):

How can i make a separate form that is a continous form with all the products. from the product table.select several items at one time. have a button that save the items i have selected and drop them in the orderdetail sub form at once.

Wait. i just realized something in my previous questions i have said or reffered my product table as a form ( my bad ).


(What i don't want):

I don't want a combo box to add the items or a list box
Sep 13 '07 #10
NeoPa
32,556 Recognized Expert Moderator MVP
Lee,

You've obviously tried so I have read your last post carefully and I think I get what you mean.
Unfortunately, what you want is quite complicated to deal with as it is not supported natively by Access. This means going into coding country I'm afraid (If anyone has a better, more supported, method then please ignore this).

Continuous forms are difficult to work with as you would probably want to tag (somehow mark) the items on the form. This is a tricky part as a bound control means each marked item would update the underlying table, and an unbound control is hard to reference from the code. Marking the product table would immediately cause problems in any sort of multi-user application so is not a good route to travel. I will see if I can determine how to reference individual unbound controls in a repeating section of a continuous form. I know it's tricky. Another alternative is to add each item to the order as it is flagged (a bit like clicking a button for each required one in the list really). This is probably going to be the best approach for you.

After flagging the items I presume you would want to click a button which would cause these items to be added to the current order. I'm not sure how you intend to add other relevant info such as quantity etc.

I suggest that adding items (probably not fully qualified with quantities etc) directly into your OrderDetail table is probably not a good idea and a temporary table might be a safer option (likely to throw up fewer data inconsistencies).

Does this sound like the level of work / effort that you could envisage getting involved in?
I can't see a simpler approach.
Sep 13 '07 #11
NeoPa
32,556 Recognized Expert Moderator MVP
It turns out that referring to flags (unbound control) on individual lines is actually impossible. Although it shows the control in each record, the value is only stored once and trying to flag any individual record will simply flag them all.

It seems that the only way to go about this is to have a command button (or any other trigger device) add the current record and you would select all the products you need one by one from this form. A command button within the detail section will repeat itself on the continuous form, but it will select that record automatically, perhaps saving at least one step in the process.
Sep 13 '07 #12
lee123
556 Contributor
Hey NeoPa, thanks for reading my question, You know i thought i would have to draw pictures because it would probably be the only way i could explain it. Ha ha.

I read your last response and i all for trying anything so if you could tell me how this can be done or what i need on what form it would be for trying.

I know in visual basic you can do what i have explained i think. i thought access you could too. but i guess i was wrong. but i'll try what you say if you can explain it to me.

thanks
lee123
Sep 13 '07 #13
NeoPa
32,556 Recognized Expert Moderator MVP
Well Lee,

I don't want to get too heavily involved in your project as it is, after all, your project.
I'm happy to explain certain aspects in more detail if that's required, but this is likely to be quite complicated so I will need to respond to your questions rather than pitch the whole thing at you again at a level that makes sense to you. I have no way of knowing what that level would need to be.

Remember, we on this side of the fence, are at quite a disadvantage as we can't see your databases or many of the details of your problems. We rely entirely on what you tell us. Anything you overlook - we don't get to know about. If your explanation is made up of half-formed sentences that don't actually make literal sense, that can be very confusing too.
In natural speech with someone who can see your face and pick up various clues that is less critical. In a technical forum it can make the difference between an answer and being ignored.

Back to the question.
Let me know what you understand and what you need help with. If you don't understand what I'm talking about at this stage it's probably better that we don't attempt this. It does rely on both parties having a rudimentary understanding at least of the principals. I will give the matter some thought anyway while I await your response.
Sep 14 '07 #14
lee123
556 Contributor
well i understand, It was a thought i thought could be done and your right explaining the problem or project did take awhile but now that i know what i'm looking at i'll just stay with what i have instead of changing it but thanks for getting back with me

lee123
Sep 14 '07 #15
NeoPa
32,556 Recognized Expert Moderator MVP
You're welcome Lee.
It's funny how some ideas can seem quite simple but when you get down to looking at them in detail they're much more complicated. I think this is one of those. Not impossible, but certainly not a simple one anyway.
Good luck with your project.
Sep 16 '07 #16
lee123
556 Contributor
yea you too for your help.

lee123
Sep 16 '07 #17

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

Similar topics

2
by: Andrea | last post by:
Hi, I'm trying to emulate part of our client-server application as a web site so customers can use it, and I'm stuck when it comes to re-ordering items in a list. Basically we have a list of...
5
by: MaJoHu | last post by:
I've got a list where u can select some products. It's something like this: <SELECT NAME='Product' MULTIPLE SIZE='10'> <% 'Get every possible item from items table SQL = "SELECT DISTINCT...
4
by: headware | last post by:
I have a <select> control that contains many entries. It allows the user to multi-select a group of them, click a button, and store the selected data in a database. Normally they do this starting...
4
by: Marek Mänd | last post by:
This seems an IE issue only: 4253 bytes testcase: http://www.hot.ee/idaliiga/testcases/ieselect/bnlinkingselectinmsie.htm Can one have 1) a mouseover/mouseout element on TBODY 2) change in...
6
by: Ben Hallert | last post by:
Hi guys, I'm trying to figure out what bone headed mistake I made on something I put together. I've got a form (named 'context') that has a variable number of select-multiple inputs on it. ...
5
by: Phill W. | last post by:
(VB'2003) What's the correct way to remove multiple, selected items from a ListView control (say, from a ContextMenu)? I ask because I'm getting a very annoying ArgumentOutOfRangeException...
6
by: TCook | last post by:
Hello, I was wondering if anyone has a code snippet for looping through a 'select' control's 'option' elements? Do I have to use an ASP.Net web control such as an asp list control or dropdown...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
25
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.