473,386 Members | 1,810 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.

Use form code on records created with append query

32
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.
Oct 15 '07 #1
6 2175
MMcCarthy
14,534 Expert Mod 8TB
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.
Oct 15 '07 #2
ringer
32
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.
Oct 15 '07 #3
ringer
32
Any other thoughts? Thanks
Oct 19 '07 #4
NeoPa
32,556 Expert Mod 16PB
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.
Oct 21 '07 #5
Denburt
1,356 Expert 1GB
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.
Nov 5 '07 #6
MMcCarthy
14,534 Expert Mod 8TB
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.
  1. By use of a data entry form
  2. 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
Nov 5 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

8
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,...
3
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...
13
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...
13
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...
3
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...
1
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...
1
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...
4
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....
11
beacon
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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.