I need to run an append query when I open my db that will look at a date in
the records and copy the records when date() >= [PeriodEndDate] and some
other criteria.
I have the append query working perfectly. But the records still need to
have some code run on them to set up fields in the new records that should
not be copied from the old records. It is mostly math and date manipulation
using values in some fields to compute with and write the results to other
fields. When I set the records up manually all the code runs behind the form
to set up these other fields.
What I'm trying to do here is automate the creation of some of the records.
How do I get the code to run on the automatically appended records to get
them set up like the ones I set up manually?
Thank you.
6 2179 MMcCarthy 14,534
Recognized Expert Moderator MVP
I'm sorry I don't really understand what you mean by code running on records created by the append query.
When do you run the append query?
How is the form then opened?
What code are you trying to apply?
When do you want to trigger this?
Remember we can't see your database and it can be very difficult to follow someone elses logic.
When do you run the append query?
My thought was that it should run when the db opens. That way the changes to existing records, addition of new records, and changes to the new records are all done before I can launch any reports or forms.
How is the form then opened?
The form where I manually create the records is in the Forms section of the db, but it wouldn't need to be opened if there were no records needing to be manually created. Automating record creation should mean I only manually create 25% of the records instead of 100%.
What code are you trying to apply?
The code that runs behind the form when I manually create a record does several things as I'm creating the record, depending on what control I'm editing at that time. In some places it takes dates that were input and generates dates for other fields. In other places it does math based on numbers and amounts and dates in other controls, and then writes the results to the appropriate fields. The code actually automates a lot of the tasks that need to be done on data that is input into the form.
When do you want to trigger this?
The code that finishes setting up the automatically appended records should probably run right after the append query runs when opening the db.
Any other thoughts? Thanks
NeoPa 32,564
Recognized Expert Moderator MVP
Ringer,
I'm going to have a look at this for you, but could I ask that you do something for me.
As Mary explained, it's very difficult to follow someone's explanation when it gets complicated (as yours is) unless it's explained in a very organised manner. I appreciate that you've already done a lot of work answering Mary's questions and that's a great attitude. However, I'm still finding it hard to sift out the information. I'm sure it's all there, but I actually struggled to put it all together into something that made sense.
What I'd like you to do (if you don't mind) is to redo it from scratch (in this thread). Bearing in mind the point Mary made about how much we know before you tell us (zilch) and how confusing it can be when talking about a database to refer to "the records..."
Take us through what you want it to do and how you currently envisage this taking place.
Try always to remember to give a token to a set of records that you can refer to later - as well as the tables. I think you're copying records from one table to another. Neither table is named yet and that helps people to understand things (names).
If you can manage to do this for us I'm sure we can spend a little more time on working out the answer. The hard part is generally understanding the question (you're certainly not unique in that respect). I suspect this is a question with a perfectly sensible answer. Let's see if we can find it.
Denburt 1,356
Recognized Expert Top Contributor
If I may step in here (I know a little late) I think what you are looking to do ringer is run your append query then run some VBA code to manipulate the data that was added, or add more records depending on what was initially entered with the append query. Am I correct?
I think you answered Mary's question quite well but some pieces of this puzzle are still missing and that is what we actually need more info on.
MMcCarthy 14,534
Recognized Expert Moderator MVP
OK ringer
I'm going to post what I think is going on and you can tell me if I'm right or wrong.
You have a table that has records added to it in two different ways. - By use of a data entry form
- by an append query
When you use the data entry form to add these records you use code to calculate certain values
You are looking for a way to duplicate this process when using the append query.
If I am right then there are two ways this can be done. You cannot force the records through the process of the form code which is what I think your question was asking. Your two options are: - to change the append query to one written in code using recordsets.
- to try to build the actions into the append query.
We can help with this depending on which route you want to go down.
Due to other commitments I'm not always around but Denburt and NeoPa can also help.
However, if what I have outlined above is not correct then please clarify.
Mary
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sans Spam |
last post by:
Greetings! I have a table that contains all of the function
permissions within a given application. These functions are different
sections of a site and each has its own permissions (READ, WRITE,
UPDATE, DELETE) which are controlled by a web frontend and the table
records are manipulated to control the permissions.
Example:
The Press...
|
by: matthewemiclea |
last post by:
I am trying to display information in Access on a form that takes
information from many different queries and puts them together on a
spreadsheet or chart.
Some specific info: The information I am displaying consists of a work
order schedule(for the current date), work orders completed , work
orders not completed, a past due schedule, past...
|
by: ricky.agrawal |
last post by:
I'm really not sure how to go about this in Access. What I've created
is a table for each location. Those tables are identical in format but
different in information.
The tables are named after key points such as the store number and the
store ID. The fields of those tables are generic fields such as sales
per day, bank deposit and what...
|
by: kev |
last post by:
Hi all,
I have created a database for equipments. I have a form to register the
equipment meaning filling in all the particulars (ID, serial, type,
location etc). I have two buttons at the end of the form which is
submit and cancel. After i have clicked submit, the information is
stored directly into my corresponding database table. My...
|
by: DHarris |
last post by:
I created a continuous form in Access2003 based on a query that users review customers and once reviewed clicks on a command button that executes an append query to update a table of the reviewed customer(s) data. The table includes the fields: customer_number, shipto_number . I also need to include the date reviewed and the user who performed...
| |
by: jeffro |
last post by:
I have a database used for recording survey data. In the database, I
have a form that displays a survey participant and a subform that is
filled in by selecting a question from a looklist and then a
response. The questions are held in a table and they are always the
same. This is what I want to do.
I want a button on the main form that...
|
by: Shortstuff12345 |
last post by:
This can be ignored... I did a bunch more searching and tried a few more things listed on different posts. I was able to get the delete query to work properly by adding a statement in the code (Me.Requery) to refresh the information on the form and the #deleted went away.
...
|
by: Rick |
last post by:
Access2003 in XP
I'm using the code below to append any new records from
(tbl_From_Mainframe) into (tbl_Appended_Data).
It takes more than a minute to search 7000 records for a dozen new
records.
The file I'm searching is in a data farm so I'm stuck with using it in
its present format.
Linking to the file or importing it as a local table...
|
by: beacon |
last post by:
Hi everybody,
I created a database that links one table from an ODBC data source. I saved my password and UID to the data source so neither myself nor anyone else would have to login each time (that's just bonus background info).
I take this table, which is read-only, and run an APPEND query that adds new items from the table into another...
|
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...
|
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...
| |
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. ...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |