473,657 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Please: Logging Transaction Activity while Updating Quantity

Hi,
I am working on a checkout/inventory system. How can I make a button
that when pressed, would update the previous fields transaction number
to a table (for example, -3 printers, so that printer total is now 20
instead of 23) while also logging the transaction in another table
(for example, logging the date and -3 printers).

I have another question, while a value is selected by a combo box, how
can I retrieve it? I mean, I want one combo box to have general
categories (for example, all eletronic machines), and when an item is
selected from it (for example, printers), I want the second combo box
to display specific listings within the category (for example,
Lexmark, HP, Dell). My question is, how would the second combo box be
able to retrieve the selection from the first and update itself?

Thanks so much.
Nov 13 '05 #1
5 1712
Your first question is a big one. For an introduction, see:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html

For your second question, this should show you how to modify the RowSource
of the 2nd combo based on the contents of the first:
Limit content of combo/list boxes
at:
http://www.mvps.org/access/forms/frm0028.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
Hi,
I am working on a checkout/inventory system. How can I make a button
that when pressed, would update the previous fields transaction number
to a table (for example, -3 printers, so that printer total is now 20
instead of 23) while also logging the transaction in another table
(for example, logging the date and -3 printers).

I have another question, while a value is selected by a combo box, how
can I retrieve it? I mean, I want one combo box to have general
categories (for example, all eletronic machines), and when an item is
selected from it (for example, printers), I want the second combo box
to display specific listings within the category (for example,
Lexmark, HP, Dell). My question is, how would the second combo box be
able to retrieve the selection from the first and update itself?

Thanks so much.

Nov 13 '05 #2
Thanks for your reply. Regarding the second question, I viewed the
page you showed me, but still have some questions.

To retrieve the result of my first combo box, is this the correct
statement to use to locate its value
"Forms!frmCheck out!CmbInvoiceN umber;" where frmCheckout is the form
that it is on and CmbInvoiceNumbe r is the name of the combo box. I
tried this and it does not work.

The full SQL statement I used in the row source field of the second
combo box is this:
"SELECT TblStock.[Part Number] FROM TblStock WHERE TblStock.[Invoice
Number] = Forms!frmChecko ut!CmbInvoiceNu mber;"
I know it is correct except for the last part since I can change the
after = part to a specific value and it would work.

Can anyone shed light to where I am making my error?

Thannks.

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message news:<41******* *************** *@per-qv1-newsreader-01.iinet.net.au >...
Your first question is a big one. For an introduction, see:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html

For your second question, this should show you how to modify the RowSource
of the 2nd combo based on the contents of the first:
Limit content of combo/list boxes
at:
http://www.mvps.org/access/forms/frm0028.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
Hi,
I am working on a checkout/inventory system. How can I make a button
that when pressed, would update the previous fields transaction number
to a table (for example, -3 printers, so that printer total is now 20
instead of 23) while also logging the transaction in another table
(for example, logging the date and -3 printers).

I have another question, while a value is selected by a combo box, how
can I retrieve it? I mean, I want one combo box to have general
categories (for example, all eletronic machines), and when an item is
selected from it (for example, printers), I want the second combo box
to display specific listings within the category (for example,
Lexmark, HP, Dell). My question is, how would the second combo box be
able to retrieve the selection from the first and update itself?

Thanks so much.

Nov 13 '05 #3
Concatenate the value from the combo into the string:

strSQL = "SELECT TblStock.[Part Number] FROM TblStock WHERE
TblStock.[Invoice Number] = " & Forms!frmChecko ut!CmbInvoiceNu mber & ";"

If the bound column of the combo a field of type Text, you need extra
quotes:

strSQL = "SELECT TblStock.[Part Number] FROM TblStock WHERE
TblStock.[Invoice Number] = """ & Forms!frmChecko ut!CmbInvoiceNu mber & """;"

If the combo is on the same form, you can use
Me
in place of
Forms!frmChecko ut

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
Thanks for your reply. Regarding the second question, I viewed the
page you showed me, but still have some questions.

To retrieve the result of my first combo box, is this the correct
statement to use to locate its value
"Forms!frmCheck out!CmbInvoiceN umber;" where frmCheckout is the form
that it is on and CmbInvoiceNumbe r is the name of the combo box. I
tried this and it does not work.

The full SQL statement I used in the row source field of the second
combo box is this:
"SELECT TblStock.[Part Number] FROM TblStock WHERE TblStock.[Invoice
Number] = Forms!frmChecko ut!CmbInvoiceNu mber;"
I know it is correct except for the last part since I can change the
after = part to a specific value and it would work.

Can anyone shed light to where I am making my error?

Thannks.

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message

news:<41******* *************** *@per-qv1-newsreader-01.iinet.net.au >...
Your first question is a big one. For an introduction, see:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html

For your second question, this should show you how to modify the RowSource of the 2nd combo based on the contents of the first:
Limit content of combo/list boxes
at:
http://www.mvps.org/access/forms/frm0028.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
Hi,
I am working on a checkout/inventory system. How can I make a button
that when pressed, would update the previous fields transaction number
to a table (for example, -3 printers, so that printer total is now 20
instead of 23) while also logging the transaction in another table
(for example, logging the date and -3 printers).

I have another question, while a value is selected by a combo box, how
can I retrieve it? I mean, I want one combo box to have general
categories (for example, all eletronic machines), and when an item is
selected from it (for example, printers), I want the second combo box
to display specific listings within the category (for example,
Lexmark, HP, Dell). My question is, how would the second combo box be
able to retrieve the selection from the first and update itself?

Thanks so much.

Nov 13 '05 #4
Thanks for your reply. But somehow when I used the statement below,
Access returns the primary key of the field instead of the value I
wanted. For example, when I selected a value from the top combo box,
access returns the following SQL statement to the second combo box:
SELECT TblStock.[Part Number] FROM TblStock WHERE TblStock.[Invoice
Number] = "2";

"2" is apparently the primary key I have for the table, but I wanted
it to return not that number but the invoice number, which is the one
I selected. Is there a way to do that, or am I doing something wrong?

Thanks.
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message news:<41******* *************** *@per-qv1-newsreader-01.iinet.net.au >...
Concatenate the value from the combo into the string:

strSQL = "SELECT TblStock.[Part Number] FROM TblStock WHERE
TblStock.[Invoice Number] = " & Forms!frmChecko ut!CmbInvoiceNu mber & ";"

If the bound column of the combo a field of type Text, you need extra
quotes:

strSQL = "SELECT TblStock.[Part Number] FROM TblStock WHERE
TblStock.[Invoice Number] = """ & Forms!frmChecko ut!CmbInvoiceNu mber & """;"

If the combo is on the same form, you can use
Me
in place of
Forms!frmChecko ut

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
Thanks for your reply. Regarding the second question, I viewed the
page you showed me, but still have some questions.

To retrieve the result of my first combo box, is this the correct
statement to use to locate its value
"Forms!frmCheck out!CmbInvoiceN umber;" where frmCheckout is the form
that it is on and CmbInvoiceNumbe r is the name of the combo box. I
tried this and it does not work.

The full SQL statement I used in the row source field of the second
combo box is this:
"SELECT TblStock.[Part Number] FROM TblStock WHERE TblStock.[Invoice
Number] = Forms!frmChecko ut!CmbInvoiceNu mber;"
I know it is correct except for the last part since I can change the
after = part to a specific value and it would work.

Can anyone shed light to where I am making my error?

Thannks.

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message

news:<41******* *************** *@per-qv1-newsreader-01.iinet.net.au >...
Your first question is a big one. For an introduction, see:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html

For your second question, this should show you how to modify the RowSource of the 2nd combo based on the contents of the first:
Limit content of combo/list boxes
at:
http://www.mvps.org/access/forms/frm0028.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
> Hi,
> I am working on a checkout/inventory system. How can I make a button
> that when pressed, would update the previous fields transaction number
> to a table (for example, -3 printers, so that printer total is now 20
> instead of 23) while also logging the transaction in another table
> (for example, logging the date and -3 printers).
>
> I have another question, while a value is selected by a combo box, how
> can I retrieve it? I mean, I want one combo box to have general
> categories (for example, all eletronic machines), and when an item is
> selected from it (for example, printers), I want the second combo box
> to display specific listings within the category (for example,
> Lexmark, HP, Dell). My question is, how would the second combo box be
> able to retrieve the selection from the first and update itself?
>
> Thanks so much.

Nov 13 '05 #5
You can sort this out if you create yourself a query.
Have it return the field you want.
Switch the query to SQL View (View menu).
Now you can see the kind of statement that you must produce in your string.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"J. Yuan" <jw****@mail.co m> wrote in message
news:e5******** *************** ***@posting.goo gle.com...
Thanks for your reply. But somehow when I used the statement below,
Access returns the primary key of the field instead of the value I
wanted. For example, when I selected a value from the top combo box,
access returns the following SQL statement to the second combo box:
SELECT TblStock.[Part Number] FROM TblStock WHERE TblStock.[Invoice
Number] = "2";

"2" is apparently the primary key I have for the table, but I wanted
it to return not that number but the invoice number, which is the one
I selected. Is there a way to do that, or am I doing something wrong?

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2971
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are supposed to be reported on the printer but I have commented those pieces of code and have got those records printed on the screen. I am using Microsoft Visual C++ 6.0 on Microsoft XP (Home) platform. I am facing some problems in getting desire...
1
5176
by: Kunal | last post by:
Hi, I need some help on writing an update query to update "UnitsSold" field in Products Table whenever I save a transaction. The transaction may contain several "Subtransactions", one for each product sold in that transaction. I have a subtransaction table that maintains record of each subtransaction, with data such as: ProductID, Quantity, TransactionID etc. The Products table has fields: ProductID, UnitsSold, UnitsOrdered,...
9
5855
by: simon.harris | last post by:
I have a 'master' stock list with current stock levels (integer) and another table that contains transactions (i.e. item#, #items added/ removed, date, user etc). What I need is an update query that runs down the transaction table and modifies the 'master' stock level accordingly. I've created an 'update query' and put in the field. In the 'update to' slot I've got ! + ! Running the query comes up with the message 'updating n records'...
1
5490
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the following code after the "Application.Run(new VMSMain());": static void Main() { Application.Run(new VMSMain()); }
2
1891
by: igendreau | last post by:
I am developing an inventory database. The warehouse operator has an "Edit Inventory" form where he makes changes to incoming quantities. He can pull up a line item, and enter how many just came in the door, which will in turn update the total quantity. I need to be able to log each of those transactions, so that I can run a report showing all inbound activity. Or for a given line item, I could run a report showing all the inbound...
15
2569
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to determine who needs to receive the text message then send the message to the address. Only problem is, the employee may receive up to 4 of the same messages because each thread gets the recors then sends the message. I need somehow to prevent...
3
2229
by: gehegeradeaus | last post by:
Is there a way to prevent one user-account from logging in twice on the same system when using sessions? I also put the session of a user in a mysql database : CREATE TABLE `login_sessions` ( `login_id` int(10) unsigned NOT NULL auto_increment, `login_session_id` varchar(32) NOT NULL default '', `login_user_id` int(10) unsigned NOT NULL default '0', `login_date` int(14) unsigned NOT NULL default '0',
1
4693
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I have a gridview which I added a <asp:CommandField EditText="E" CancelText="C" UpdateText="U" ButtonType="Link" ShowEditButton="True" /> my gridview looks like this <asp:GridView ID="GridView1" runat="server" OnRowEditing="RowEdit" OnRowCancelingEdit="RowCancel" OnRowUpdating="RowUpdating"...
4
3426
by: lfhenry | last post by:
I am a newbie to HADR and Admin of DB2 (I am websphere guy). My question relates to DB2 logging. I've read that HADR does not allow Infinite logging (-1). I am expecting my Database to grow 8-10GB's a month without compression (about 260 Megs day). What logging options should i specify before i start my database. If i set archiving using LOGARCHMETH1 to a separate disk, what should the logprimary and logsecondary values be. I would like...
0
8403
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8610
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4168
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1967
muto222
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.