Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / September 2004

Tip: Looking for answers? Try searching our database.

Batch Updating  - old values with new values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl - 27 Sep 2004 16:20 GMT
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.
Geoff - 27 Sep 2004 22:00 GMT
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
Carl - 28 Sep 2004 08:36 GMT
> 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.
Geoff - 29 Sep 2004 00:38 GMT
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
Carl - 29 Sep 2004 08:51 GMT
> Hi Carl,
>
[quoted text clipped - 9 lines]
>
> 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.
Geoff - 30 Sep 2004 14:25 GMT
Sample database sent direct to you.

Geoff
Carl - 30 Sep 2004 15:00 GMT
> > Hi Carl,
> >
[quoted text clipped - 23 lines]
>
> 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.
Geoff - 30 Sep 2004 19:52 GMT
You may not have seen my solution when you posted this.
Regards
Geoff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.