473,324 Members | 2,356 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,324 software developers and data experts.

all items

Hello All,

Just got a quick query well im hoping it is a quick one!

What i am trying to do is update records with an item table when it is removed. At the moment what is happening is if i have say 10 items and the remove button is pressed it is deleting all the records within that hire , which is fine, I can also get it to update the first item within the listbox. But it does update the other items that were within the listbox.
I know what the problem is, this is what i am using. The findfirst is only finding the first item within the listbox that matches the item table. Is there a way for it to retrieve all the items that are removed? Hope it makes sense
Expand|Select|Wrap|Line Numbers
  1. Set rsitemline= currentdatabase.OpenRecordset("select * from itemhire Where itemno =" & Forms!frmitemhire!txtorderno)
  2.  
  3. Set rsirtem= currentdatabase.OpenRecordset("tblitem")
  4.  
  5. rsirtem.FindFirst ("[itemno]='" & rsitemline("itemno") & "'")
Mar 9 '08 #1
5 1518
NeoPa
32,556 Expert Mod 16PB
...
Hope it makes sense
...
Not remotely I'm afraid :(
If you try to explain what you mean, by using terms that have no meaning except to you and your project, how can we follow you?

Please try posting this again (in here - assume the first post is not there) but pay particular attention to the logic of someone reading it.
Mar 10 '08 #2
Ok,

I currently have a system which allows hiring of items. When an item is selected this is displayed within a listbox and saved within a table. If i was to press remove then this would clear the listbox, delete from the table and update the hired item within the item table.

Currenttly say i placed an hire order for 10 items, these would all display within a listbox, then if the remove button was to be pressed, all the items would be deleted from the table hireline. This works fine, but at the same time i want to update the stock within the item table. Currently the first item within the listbox updates within the item table but the remanining items do not update.

The code displayed is the code that i am using. Hope this is more clear..
Expand|Select|Wrap|Line Numbers
  1. Set rsitemline= currentdatabase.OpenRecordset("select * from itemhire Where itemno =" & Forms!frmitemhire!txtorderno)
  2.  
  3. Set rsirtem= currentdatabase.OpenRecordset("tblitem")
  4.  
  5. rsirtem.FindFirst ("[itemno]='" & rsitemline("itemno") & "'")
Mar 14 '08 #3
NeoPa
32,556 Expert Mod 16PB
You should try reading this and seeing if you can make sense of it.
Nothing is referred. Everything expects the reader to be already aware of the system before they can make sense of it.

Do you not understand that it is your responsibility to make the question readable.

Much as I'd like to, I simply cannot help if I can't understand what you're trying to say.
Mar 14 '08 #4
sorry but my english is not as good....

lets try again.

I have an item table, hire table and item hire table

When an order is placed, the client will select the item and the quantity they require. When selected ok this will display that item within a listbox and into the itemhire table. The quantity they have selected would be decremented from the item table.
If the client then selects another item then the same procedure takes place.

If after say 6 items being ordered they decide to cancel the hire, the delete button would be pressed, this would remove all the items for this order from the itemhire table and update the quantity in the item table.

I can currently get the items to be deleted from the itemhire table that are refereced to this order but cannot get the quantity for the items to be updated within the item table.

Thanks
Mar 15 '08 #5
NeoPa
32,556 Expert Mod 16PB
Let's see if we can work with this.

I presume you're talking about managing these updates with a form of some kind.
How is the form laid out? Does it use subforms? Does the same form manage adding items as well as removing them - or is this done using a separate form?

What code do you have already on you form for use with adding the items? That may be useful as the reverse is often similar to the original with some changes. We needn't reinvent the wheel if we don't have to.
Mar 20 '08 #6

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

Similar topics

12
by: Donnal Walter | last post by:
The following method is defined in one of my classes: def setup(self, items={}): """perform setup based on a dictionary of items""" if 'something' in items: value = items # now do something...
4
by: mb | last post by:
what is the best way to do this: In a game I want to a class called "Items". This class will have the game items public class Items { public int Chair public int Table . . .and so on . . .
9
by: Alpha | last post by:
Hi, How can I set all the items in a listbox to be selected? I can't find a property or mehtod to do it so I thought I'll try using setselected method but I need to find out how many items are in...
2
by: dave | last post by:
This little problem is driving me nuts!! On my webform page I create 2 variables.. Protected p_dml As String = "I" Public Const mwv_id As Integer = 0 ' originally had mwv_id as Protected
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
2
by: hsuntn | last post by:
I am grabbing Outlook MailItems using the Items property on my Outlook inbox. When I iterate through them, I notice that they are not ordered in ReceivedTime or CreationTime order. For example, ...
0
by: Brian Henry | last post by:
Since no one else knew how to do this I sat here all morning experimenting with this and this is what I came up with... Its an example of how to get a list of items back from a virtual mode list...
13
by: Joel Koltner | last post by:
Is there an easy way to get a list comprehension to produce a flat list of, say, for each input argument? E.g., I'd like to do something like: for x in range(4) ] ....and receive
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
2
by: mygirl22 | last post by:
Hi, I used this code to created 2 combo boxes General and Specific...and Only show Specific (Combo B) when Combo A is chosen..... What i need now is to know how to assign specific values to the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.