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

Button to Advance Count in Field

Greetings,
I searched for this possibility without finding very much. It might be
too simple ?

In the simplest of terms, I need to place a button on a form, and have
it advance the number in a field by one. In other words, a table has a
field in which the default is 0. Click on the button, and the field
changes its value to 2, do it again and it goes to 3, Etc.

The above is a very simplified version of what I really need, though I
probably can't get any more sophisticated than that without some
examples of code to play with. I couldn't find anything like this in
my current code anywhere.

The Real goal someday: I have a Sales Order Form (seperate table for
Sales Order and also seperate Sales Order Line Items table). When
someone requests an item, and I happen to be out of stock and lose the
sale, I would like to press a button on the Sales Order, that would
Log a "Hit" on the Item selected, By advancing a number in the "Hits
field" for the related item in my Inventory Table (also a seperate
table now).

I would then be able to display this growing "hits field" in various
Forms and or Reports until the next time I review re-order
information, easily SEEING how many times people have looked for the
item and I did not have it.

I would simply reset the field to Zero when I finally order the item,
or maybe when it arrives and is checked in.

In the future, One could automate some of the above, such as allowing
the system to make the button visible only after inventory levels
dropped to Zero, record the date that it hit Zero, and then Resets the
information automatically after items have been received at check-in.

If I can just get the simplest of the above, I would at least have
something !

Your input appreciated.

Thanks,
Chris L
Nov 12 '05 #1
3 4306
Chris,

Say your textbox is named "Hits".

Put the following code in the click event of a button:
If IsNull(Me!Hits) Then
Me!Hits = 0
Else
Me!Hits = Me!Hits + 1
End If

You don't have to have a default of 0. The first time ever you click the button,
Hits will be 0. After that you will add 1 everytime you click the button.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Chris L" <da***@lakefield.net> wrote in message
news:7f**************************@posting.google.c om...
Greetings,
I searched for this possibility without finding very much. It might be
too simple ?

In the simplest of terms, I need to place a button on a form, and have
it advance the number in a field by one. In other words, a table has a
field in which the default is 0. Click on the button, and the field
changes its value to 2, do it again and it goes to 3, Etc.

The above is a very simplified version of what I really need, though I
probably can't get any more sophisticated than that without some
examples of code to play with. I couldn't find anything like this in
my current code anywhere.

The Real goal someday: I have a Sales Order Form (seperate table for
Sales Order and also seperate Sales Order Line Items table). When
someone requests an item, and I happen to be out of stock and lose the
sale, I would like to press a button on the Sales Order, that would
Log a "Hit" on the Item selected, By advancing a number in the "Hits
field" for the related item in my Inventory Table (also a seperate
table now).

I would then be able to display this growing "hits field" in various
Forms and or Reports until the next time I review re-order
information, easily SEEING how many times people have looked for the
item and I did not have it.

I would simply reset the field to Zero when I finally order the item,
or maybe when it arrives and is checked in.

In the future, One could automate some of the above, such as allowing
the system to make the button visible only after inventory levels
dropped to Zero, record the date that it hit Zero, and then Resets the
information automatically after items have been received at check-in.

If I can just get the simplest of the above, I would at least have
something !

Your input appreciated.

Thanks,
Chris L

Nov 12 '05 #2
"Mark" <mm*****@earthlink.net> wrote in message news:<Fl*****************@newsread3.news.atl.earth link.net>...
Chris,

Say your textbox is named "Hits".

Put the following code in the click event of a button:
If IsNull(Me!Hits) Then
Me!Hits = 0
Else
Me!Hits = Me!Hits + 1
End If

You don't have to have a default of 0. The first time ever you click the button,
Hits will be 0. After that you will add 1 everytime you click the button.


Mark,
Thanks! just what I needed to get a good start on this. Your code
example allowed me to Get that Hit button and display in Sales Orders,
Place a Hit Button and Display in Inventory, and, Place a Display, Hit
button and "Reset" button In a Purchase Order Form.

I wrestled without any results, getting the Reset button to overlay
the hit button, showing the Reset button only when the qty was greater
than 0. Hopefully I will get that working next week.

Thanks again, as this really helped out.
Chris Luebke
Nov 12 '05 #3
da***@lakefield.net (Chris L) wrote in message news:
Mark,
Thanks! just what I needed to get a good start on this. Your code
example allowed me to Get that Hit button and display in Sales Orders,
Place a Hit Button and Display in Inventory, and, Place a Display, Hit
button and "Reset" button In a Purchase Order Form.

I wrestled without any results, getting the Reset button to overlay
the hit button, showing the Reset button only when the qty was greater
than 0. Hopefully I will get that working next week.

Thanks again, as this really helped out.


Well, I came close anyhow. I have introduced a new problem.

Just like I mention above, I have made it possible from a sales order
to add a "hit", SEE the "hits" from a PO when the particular item is
selected, and place a Clear "hits" button on the po as well.

The problem is on the PO. I can not delete an item from the PO on the
first try. It will delete on the second try, as if something isn't
sequenced correctly when it comes to removing the line item.

The "Hits" field is displayed in an existing subreport that contains
other information about the Inventory Item Selected, and the "Clear
hits" button is on the main form.

Everything really works perfect, until I try to delete the Line item.
Pressing a Delete button that uses:

DoCmd.DoMenuItem acFormbar, acEditMenu, , acMenuVer70

Will remove the "qty on PO" (another field in that subform), but it
takes another Delete button attempt to get the actual line item to
disappear.

Using a different delete button that exists down in the footer(uses
acCmdDeleteRecord) will occasionally give me the run-time error 3197 -
another user is attempting to change the same data.... (Which is not
the case).

I have seen someone mention that this error can show up with a
scenario like this (updating info in a subreport), but did not leave
any options for repair.

So, I am close. If anyone cares to point out some obvious things to
check, I would be grateful.

Thanks,
Chris
Nov 12 '05 #4

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

Similar topics

15
by: qwweeeit | last post by:
Hi all, Elliot Temple on the 1 June wrote: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no...
3
by: Chris L | last post by:
Greetings, I searched for this possibility without finding very much. It might be too simple ? In the simplest of terms, I need to place a button on a form, and have it advance the number in a...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
3
by: domcatanzarite | last post by:
How would one create a button that on click advances the form to the next "non recurring record" as opposed to the next record. The field the button needs to que from has groups of duplicate...
7
by: rsaffy | last post by:
I am having trouble with my dynamically created button's event handling. I read that the buttons need to be recreated on every trip to the server, but how exactly do you do that when the datagrid...
1
by: olivier.wambacq | last post by:
hello, This sounds simple but I can't seem to manage... So I'm in a form, and have got a button to "open" (make visible) a subform. the subform actually contains fields from the same table as...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
1
by: Visual77 | last post by:
I'm trying to set up a script that checks to see how many radio buttons are set to Yes and how many are set to No. I'm using PHP to generate all the radio buttons and name them, and as it goes...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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.