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

Update data using unbound text boxes in an calculated query

I am designing an inventory system and am stuck on a potential problem.

I have a table of Stock_Catalog containing the following fields: Stock_ID (random autonumber), Full_Desc, Serial, Auto, Mem, RC, Trans_Type. These are the basic item descriptions.

I then have 5 other fields: Add (yes/no), MRR (yes/no), Qty, Unit_Price, Item_Note that come into play when the user chooses which stock item is going to be part of the transaction. User changes Add to yes, fills in the remaining 4 boxes appropriately and then hits the update macro button.

All the selected Yes are then appended to the Transaction_Lines table and through other macro'ed queries, the last 5 fields of Stock_Catalog are then reset to null or no.

I then have a query named qryInventory that calculates how many of what items I have on-hand based on all the Transaction_Lines.Qty summary. Here is where my problems arises.

I wish to be able to enable a checkbox solution as above involving only on-hand inventory in order to rapidly add the selected products to Transaction_Lines; however I cannot get qryInventory to update a table that would contain the Add...etc fields as my Stock_Catalog table does currently. I understand you shouldn't put calculated data in a table anyhow so that's not optimal.

So, I'm wondering if it's possible on a created filter form of qryInventory to add the necessary unbound text boxes and then for each line if Unbound CheckBox = yes...append the Full_Desc, and user-supplied unbound "Qty", "Unit_Price" to my Transaction_Lines table?

Is this feasible or not? Even if feasible, is there a better method to go through being able to allow the user to select which lines they wish to append to a table so as to be quickest and easiest?

Edit: The entire reason I wish to add this 2nd line of functionality is so the user is not selling items that aren't in stock.
Nov 16 '09 #1
7 3634
NeoPa
32,556 Expert Mod 16PB
Have you considered showing only the items on hand (available to sell) in the form that allows the operator to select which they're interested in. I would expect this to resolve your issue.
Nov 16 '09 #2
Yes, I have, but I can't figure out how to only list those items given the qryInventory doesn't contain the selection buttons or anything to then append to the table. I don't know how to allow an updateable segment on the calculated query.

I know I'm missing something very simple, but I don't know what exactly.
Nov 16 '09 #3
NeoPa
32,556 Expert Mod 16PB
I think if you need some help with this then I will need some more details from you :
  1. What is the name of the form you are using for this?
  2. Is the form bound to qryInventory? If not what is it bound to?
  3. What is the SQL of qryInventory (or whatever the form's bound to if not that)?
    To extract the SQL from a QueryDef (saved Access query) it is only necessary to view the query in SQL View. This shows the underlying SQL for the QueryDef and is text (See Access QueryDefs Mis-save Subquery SQL for problems with SubQueries). When a QueryDef is open (either in Design View or Datasheet View) it is possible to switch to the SQL View simply by selecting View \ SQL View from the menu.

    From here it is simple to Copy & Paste it to wherever you need it.
  4. What in the bound recordset determines whether or not you want it to be included?
Nov 16 '09 #4
Okay, I've gone a slightly different method here; 1 single form that opens upon a certain condition, a 2nd form that shows the inventory status for the associated Stock Item.

The form I'm using is Stock_Catalog, it contains the following fields: Stock_ID, Full_Description, Add, MRR, Item_Note, Order_No, Order_Type, Qty, and Unit_Price.

If the user wishes to put a stock item into a new order; they check Yes in Add...and then fill in MRR/Item_Note/Order_No/Order_Type/Qty and Unit_Price. Click Command Button and a macro runs 4 update queries that populate tables downstream. That works properly.

I want to key in an OpenForm condition AfterUpdate on the Order_Type field. There are 7 options for Order_Type (Buy/Sell/Trade In/Trade Out/Transfer In/Transfer Out). If a person is putting material into inventory be selecting Buy, Trade In or Transfer In, I don't want this event to trigger. However, if they choose Sell, Trade Out, Transfer Out, or Use, I want to open a Small Form that shows the Inventory Qty on hand.

That small form is named qryInventory and consists of Stock_ID, Full_Description and a calculated field Qty_OH.

So far, I have this as my VBA code placed under the After Update on Order Type box.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Trans_TypeLbl_AfterUpdate()
  2.  
  3.     Dim stDocName As String
  4.     Dim stLinkCriteria As String
  5.  
  6.     stDocName = "qryInventory"
  7.     stLinkCriteria = "[Stock_ID]=" & Me![Stock_ID]
  8.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  9.  
  10. End Sub
It works in that it pops up the form with the relevent selection, but it does it for every update for all 7 selection options. I want to only place it for the 4 'outgoing' transaction types. Can this be modified using If's and if so...how?
Nov 17 '09 #5
NeoPa
32,556 Expert Mod 16PB
Perhaps you could answer my questions first before going off at a tangent.
Nov 18 '09 #6
1) Form title is Search_Inventory

2) It is bound to qryInventory

3) SQL is:
Expand|Select|Wrap|Line Numbers
  1. SELECT Inventory_Detail.Stock_ID,
  2.        Inventory_Detail.Full_Description,
  3.        Inventory_Detail.[Qty OH],
  4.        Stock_Catalog.Item_Type,
  5.        Stock_Catalog.UoM,
  6.        Stock_Catalog.Sport,
  7.        Stock_Catalog.Card_Year,
  8.        Stock_Catalog.Brand,
  9.        Stock_Catalog.Subset,
  10.        Stock_Catalog.Player_Name,
  11.        Stock_Catalog.Grade,
  12.        Stock_Catalog.Auto,
  13.        Stock_Catalog.Mem,
  14.        Stock_Catalog.Serial,
  15.        Stock_Catalog.RC,
  16.        P_Hdr.*
  17.  
  18. FROM   (Stock_Catalog LEFT JOIN
  19.         P_Hdr
  20.   ON   Stock_Catalog.Player_Name=P_Hdr.Player_Name) INNER JOIN
  21.        Inventory_Detail
  22.   ON   Stock_Catalog.Stock_ID=Inventory_Detail.Stock_ID
  23.  
  24. WHERE  (Inventory_Detail.[Qty OH]>0);
4) This is where I'm stuck; there's nothing in the qryInventory to allow me to select the record as an addition. It's why I went on the tangent.
Nov 18 '09 #7
NeoPa
32,556 Expert Mod 16PB
Will,

I don't think you appreciate how difficult you are to follow. This last post is good as far as it goes, but it essentially says "Ignore my first post as it doesn't make sense." That's fine, but your next post refers back to an understanding (that I don't yet have) of what you're trying to achieve, and what you're working within.

If the English were perfect it would be hard to follow, but, like most people, your sentences flow from one to the other without correct punctuation and trying to work out exactly what you mean is difficult indeed. You can get away with this in a short paragraph of prose, but this is technical talk, and that requires accurate puncuation and putting your words in the correct order to a much higher degree. I don't mean to belittle your efforts. I'm simply hoping to illustrate why understanding your problem is not as straight forward as you may think from your side of the table. You have access to all the details. I have to rely on what you post, and if that's not very clear then I struggle.

I was hoping for something that would help me see to the heart of this matter, but unfortunately everything refers to each other in such an unstructured way that making sense is really too difficult.

Why don't we go back to something solid and see if we can work from there?
@HSXWillH
Are you saying that you have no way, within your qryInventory, of determining whether a record is stocked or not?

Bear in mind Access only provides a method to implement your logic. If the fundamental logic is flawed, or the information you want isn't even there, then Access cannot help you resolve that. The design must support the idea if the idea is to have any chance of implementation.
Nov 18 '09 #8

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

Similar topics

3
by: dixie | last post by:
I have a form full of subforms which bring summary information onto the form from about 12 different tables. I am trying to get all of that summary information (mainly numbers) into 1 large table...
3
by: James | last post by:
Hi, I have a combo box(cmboParts) and the row source is a part name. Once a part is selected I have button(cmdOrderAdd) to add data about this part to a sub-form(frmParts_Ordered). However this...
1
by: InDeSkize | last post by:
Hello my programming Super Heroes. I think this one is a no brainer, me being the one with no brain. I have a form that is used for data entry. The goal is to have an unbound form that only...
7
by: Aravind | last post by:
Hi folks. I have 2 forms, frmBorrow and frmHistory frmBorrow has an unbound multi-column combo box (cboMember) and 7 unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty, Borrow,...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
3
by: ugo_lavoie | last post by:
HEy, this is normally pretty basic stuff but i dont know if i'm tired or what but right now i just can get it. Heres the problem... I have a form base on a table. 4 field : ID_Seller,...
10
by: Gerhard | last post by:
Hi, all I run into the same problem on Access 2000 and 2003. Hopefully someone can replicate it – or not. 1. Create an unbound form – call it Form1. 2. Insert two unbound text boxes –...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
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?
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
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
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...
0
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...

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.