473,770 Members | 4,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Batch Updating - old values with new values

Hi I have a form that requires the user to enter a tenancy reference
number in the first column, and when this is done it brings back their
direct debit payment for their rent in the second column (It uses SQl
to bring back the amount when the Tenancy Reference No loses the
focus). In a third column I want the user to type in the value for
the new rent amount. This may be for one tenancy record up to 25 in
one go, for example:

Tenancy Reference No Old Payment New Payment
-------------------- ----------- -----------
|123456789 | |30.00 | |37.00 |
-------------------- ----------- -----------

-------------------- ----------- -----------
|987654321 | |20.00 | |24.00 |
-------------------- ----------- -----------

-------------------- ----------- -----------
|121212121 | |65.00 | |54.00 |
-------------------- ----------- -----------

Now my form has provision for 25 Tenancy Reference Numbers and old
payments to be entered (25 unbound text boxes for each). I have
started to do work through this and am finding that I am repeating the
same code over and over for each. I am also at a loss as to how I can
update each old figure with the newly entered one. I want the whole
lot to update when a button on the form is pressed.

As well as updating the old values with the new ones, I would like to
copy the tenancy reference numbers, old values and new values along
with the current days date to a new table so that letters can be
created for those tenants amended so they can be notified of the new
rent amount.

Could someone please put me on the right track as to the best way of
doing this. I started reading some info on Arrays but can't see how
to use them with what I'm trying to do.

Can anyone point me to an example in a demo database or FAQ website
for Access?

The simpler the recommended solution, the better. Thanks in advance
for any suggestions.

Regards.
Nov 13 '05 #1
7 2353
It sounds like you've not normalised the structure of your tables. If
this is the case, you'd be best to read up on this topic (normalising)
and restructure your tables accordingly.
Regards
Geoff
Nov 13 '05 #2
"Geoff" <ge***@nospam.c om> wrote in message news:<cj******* ***@newsg2.svr. pol.co.uk>...
It sounds like you've not normalised the structure of your tables. If
this is the case, you'd be best to read up on this topic (normalising)
and restructure your tables accordingly.
Regards
Geoff


Hi Geoff,

The table is a flat file. Each record stores data about a tenant.
There is no repetitive data.

What I am trying to do is a batch update based on data already stored
for each tenant. For example, each tenant in the database is paying
their rent by direct debit. What I need to do is produce a form
allowing the user to enter up to 25 tenancy reference numbers. When
each Ten ref no is entered the unbound text box next to it displays
the current direct debit payment. In the third column the user needs
to be able to type in a new direct debit amount for that tenant and so
on down the list. There will probably be a different amount for each
tenant.

I need an efficient way (hopefully without duplicating code for each
Ten ref no – on lost focus event) that isn't to complex to be able to
replace each old direct debit value with the new direct debit value
entered by the user in one go – preferably at the click of a button.
But I also want these 3 pieces of information appended to a new table
with the current date so that letters can be sent to each of the
tenants informing them of what their new direct debit payment is.

Hope this make more sense.

Cheers.
Nov 13 '05 #3
Hi Carl,

OK - I've got it. Looks like the tenancy reference number is unique
for each record and is probably the primary key.

Are your tables in an Access database (mdb) file?

If so, you could use DAO to achieve your aim without repetitive code
using the click event of a command button. I'll send some sample code
Wed pm if you need it. Presumably, the form is cleared of all data
when the button is clicked?

Geoff
Nov 13 '05 #4
"Geoff" <ge***@nospam.c om> wrote in message news:<cj******* ***@newsg2.svr. pol.co.uk>...
Hi Carl,

OK - I've got it. Looks like the tenancy reference number is unique
for each record and is probably the primary key.

Are your tables in an Access database (mdb) file?

If so, you could use DAO to achieve your aim without repetitive code
using the click event of a command button. I'll send some sample code
Wed pm if you need it. Presumably, the form is cleared of all data
when the button is clicked?

Geoff


Hi Geoff,

Yes the system is an access database, and the tenancy reference number
cannot be duplicated. As explained I need a program to update the
displayed payments with the new ones entered by the user based on the
tenancy reference they entered.

I appreciate you posting the code for me. I'm sure it will be a big
help. I have tried a number of different solutions and when part way
through realised I have used the wrong approach. I am banging my head
off a brick wall at the minute, so your help will be appreciated.

Cheers.
Nov 13 '05 #5
Sample database sent direct to you.

Geoff

Nov 13 '05 #6
ca**********@ne wcastle.gov.uk (Carl) wrote in message news:<ab******* *************** ***@posting.goo gle.com>...
"Geoff" <ge***@nospam.c om> wrote in message news:<cj******* ***@newsg2.svr. pol.co.uk>...
Hi Carl,

OK - I've got it. Looks like the tenancy reference number is unique
for each record and is probably the primary key.

Are your tables in an Access database (mdb) file?

If so, you could use DAO to achieve your aim without repetitive code
using the click event of a command button. I'll send some sample code
Wed pm if you need it. Presumably, the form is cleared of all data
when the button is clicked?

Geoff


Hi Geoff,

Yes the system is an access database, and the tenancy reference number
cannot be duplicated. As explained I need a program to update the
displayed payments with the new ones entered by the user based on the
tenancy reference they entered.

I appreciate you posting the code for me. I'm sure it will be a big
help. I have tried a number of different solutions and when part way
through realised I have used the wrong approach. I am banging my head
off a brick wall at the minute, so your help will be appreciated.

Cheers.


Hi Geoff,

Any chance you can post the DAO solution for me as I have looked into
it and am not getting very far to quickly.

Cheers again for your help.
Nov 13 '05 #7
You may not have seen my solution when you posted this.
Regards
Geoff
Nov 13 '05 #8

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

Similar topics

11
16225
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
2
9920
by: brad | last post by:
I am new to perl and would like to know how to check the return values of a perl program in a batch file. how can I save the return value of the perl program and use it to make decisions as to what I should do next in the batch file?
0
936
by: shumaker | last post by:
How do I prevent repainting while updating a batch of controls? Datagrids have functions to do this, but many other controls do not. I have a large number of controls that I update a few times a second, and everytime I set a property of each control the form is redrawn. I would like to suppress redrawing until I am done updating all the controls. Also the member function that is in the form class that iterates through the controls to...
4
2376
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has two fields: a primary key and another holding a string. In table B there are three fields: a primary key, a foreign key (which links to the primary key in A) and other field holding a string.
7
7898
by: mark.a.lemoine | last post by:
Our application currently interfaces to SQL Server and Oracle, we're implementing it into DB2 currently and I have a question to ask. First a little background - We're interfacing into DB2 v8 on zOS (I hope the terminology is right - ours is a Windows client app, and the DB2 is at a customer site and they are taking care of the server), using ADO with the IBM OLE Db Provider (IBMDADB2). We don't use any vendor specific APIs, instead we...
0
2383
by: Sharath | last post by:
"Inspired" by the huge success of our first two automation fast track batches We are forced to start third fast track automation batch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++ Course on Automation, QTP Basics and Advanced, Quality Center and project ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
0
2197
by: Sharath | last post by:
We are glad to inform you that "Inspired" by the huge success of our first three automation fast track batches We are forced to start fourth fast track automation batch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Course on Automation, QTP Basics and Advanced, Quality Center and project
0
2074
by: Sharath | last post by:
We are glad to inform you that "Inspired" by the huge success of our first four automation fast track batches We are forced to start fifth fast track automation batch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Course on Automation, QTP Basics and Advanced, Quality Center and project
0
1493
by: =?Utf-8?B?UnVzdHlfUm9zZXI=?= | last post by:
Hi everyone, I'm having some issues figuring out how to complete certain tasks with a batch file, whether it be not knowing the right syntax or if it can even be accomplished with a batch file. Heres my problem. I work in the IT department at a local bank and we are in the process of deploying new PCs for some of the employees with older work stations. I just finished staging about a dozen of them and in the next month or so we will...
0
9591
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
9425
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,...
1
10002
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8883
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...
1
7415
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5312
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
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
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
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.