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

Create a new record in one table when a record is created in another?

25
Hi folks,

I am trying to set up my database to create a new record in one table when a new record is created in another. Since it is a one-to-one realtionship it certainly would be easier to put the data into one table. Originally it was one table, but I split the table to create conditional field-level security (read-only unless one box was unchecked). However I'm trying to fix one flaw in the whole scheme: When a user adds a new record in Table1, there's no matching record in Table2. When I tried creating an append query Table2 doesn't apear on the list of table to append to. (All other table were listed. They wer all created before I implemented User-Level Security. Could that have an effect?)

If I could make it work then all I would have to do is the following:

Code the Button_OnClick to run the script to

1. If the IDNo = IsNull Then Run AppendQuery to add the new record. (with Forms!Table1Data!IDNo as the criteria)
2. If CheckBox = False Then Run RWOPQuery to edit the record (with same criteria.
3. Else show msgbox "This record is locked."

If anyone has a simpler idea, please share!

Doug
Nov 6 '07 #1
1 2184
dstorms
25
Never mind... I found the culprit:

Apparantly when creating the append query, Access lists all the table *except* the first one on the list. Renaming the table to move it down the alphabetical list solved that problem.

Doug
Nov 6 '07 #2

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

Similar topics

0
by: DaveS | last post by:
Hello, I'm using Oracle 9.2 and would like to automatically save a copy of each deleted record in XML format to another database table. There would be one XML record for each deleted record. ...
3
by: Peter Phelps | last post by:
My problem is as follows: I need automatically iterate through a single field in a table and use the values in the field to create an in-statement. Currently, the character limitation in the...
0
by: Jonathan Fisher | last post by:
Whatıs the appropriate way to create records in related, subsidiary tables when a record is created in a main table? Iım using Access 2000, and I have a main table called tblProject, and a few...
3
by: Steven Stewart | last post by:
Hi there, I have posted about this before, but yet to arrive at a solution. I am going to try to explain this better. I have an Employees table and a Datarecords table (one-to-many...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
3
by: TheDude5B | last post by:
Hi, i am wanting to add some data to one table within my MySQL database using asp.net in VB, however, i want to also add some of the same data to another table at the same time. Easy yes, but...
0
by: Andy_Khosravi | last post by:
I'm having a problem trying to optimize the performance of one of my A97 databases. I have very slow record navigation after a change I made to the table structure, and I'm not sure how best to...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
12
by: tekctrl | last post by:
Environment; Win2K PC with 1Gb of RAM and plenty of HD space running Access 2002 Issue; Access presents a blank data entry form in the Forms view when the New Record icon is used. However, it...
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...
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
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
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
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...
0
tracyyun
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...

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.