473,385 Members | 2,029 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,385 software developers and data experts.

Adding a new Record and updating mutiple Tables

I have 5 tables in my db and when i bring up the linked form I get my
product lists

Tbls are tbStock, which contain unitcost, sellprice n qty
tblProduct, contains ID, medicalname n genericname
tblCat contains ID, catname and catcode
tblPacket which ID, contains packetcode and description
tblSize which ID, contains the size code and description

the form has the StockID(hidden), catname(combo), medicalname,
genricname, packdescription(combo), unicost, sellprice n qty

2 buttons add and save record.

when the form opens i can see all the dat in my tables.

when add button is clicked the table emties and i can key in new details
but i cant write to the cost,sell n qty fiels dont allow me to key in
the detail, and when i click the save button the all other info is
created as new records in the all tables but the price and qty info is not.

Following is the code that the wizard wrote:

Option Compare Database

Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click
DoCmd.GoToRecord , , acNewRec

Exit_cmdAddRecord_Click:

Exit Sub

Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click

End Sub
Private Sub cmdAddNewSave_Click()
On Error GoTo Err_cmdAddNewSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_cmdAddNewSave_Click:
Exit Sub

Err_cmdAddNewSave_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewSave_Click

End Sub

Nov 12 '05 #1
3 4802
I don't see any foreign key fields to relate the tables. I'd guess that
tbStock, or a Query including it, is RecordSource for the Form, and, perhaps
we can assume that unitcost, sellprice, and qty are Control Source for Text
Boxes, but for the Combos it appears you are indicating RowSource, not
Control Source. If you could clarify, it'd help someone to help you.

Larry Linson
Microsoft Access MVP

"LouD" <du******@yahoo.com> wrote in message
news:WC********************@news-server.bigpond.net.au...
I have 5 tables in my db and when i bring up the linked form I get my
product lists

Tbls are tbStock, which contain unitcost, sellprice n qty
tblProduct, contains ID, medicalname n genericname
tblCat contains ID, catname and catcode
tblPacket which ID, contains packetcode and description
tblSize which ID, contains the size code and description

the form has the StockID(hidden), catname(combo), medicalname,
genricname, packdescription(combo), unicost, sellprice n qty

2 buttons add and save record.

when the form opens i can see all the dat in my tables.

when add button is clicked the table emties and i can key in new details
but i cant write to the cost,sell n qty fiels dont allow me to key in
the detail, and when i click the save button the all other info is
created as new records in the all tables but the price and qty info is not.
Following is the code that the wizard wrote:

Option Compare Database

Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click
DoCmd.GoToRecord , , acNewRec

Exit_cmdAddRecord_Click:

Exit Sub

Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click

End Sub
Private Sub cmdAddNewSave_Click()
On Error GoTo Err_cmdAddNewSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdAddNewSave_Click:
Exit Sub

Err_cmdAddNewSave_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewSave_Click

End Sub

Nov 12 '05 #2
I am not sure how I can describe this, if its ok with u I could email yu
my db

Larry Linson wrote:
I don't see any foreign key fields to relate the tables. I'd guess that
tbStock, or a Query including it, is RecordSource for the Form, and, perhaps
we can assume that unitcost, sellprice, and qty are Control Source for Text
Boxes, but for the Combos it appears you are indicating RowSource, not
Control Source. If you could clarify, it'd help someone to help you.

Larry Linson
Microsoft Access MVP

"LouD" <du******@yahoo.com> wrote in message
news:WC********************@news-server.bigpond.net.au...
I have 5 tables in my db and when i bring up the linked form I get my
product lists

Tbls are tbStock, which contain unitcost, sellprice n qty
tblProduct, contains ID, medicalname n genericname
tblCat contains ID, catname and catcode
tblPacket which ID, contains packetcode and description
tblSize which ID, contains the size code and description

the form has the StockID(hidden), catname(combo), medicalname,
genricname, packdescription(combo), unicost, sellprice n qty

2 buttons add and save record.

when the form opens i can see all the dat in my tables.

when add button is clicked the table emties and i can key in new details
but i cant write to the cost,sell n qty fiels dont allow me to key in
the detail, and when i click the save button the all other info is
created as new records in the all tables but the price and qty info is


not.
Following is the code that the wizard wrote:

Option Compare Database

Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click
DoCmd.GoToRecord , , acNewRec

Exit_cmdAddRecord_Click:

Exit Sub

Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click

End Sub
Private Sub cmdAddNewSave_Click()
On Error GoTo Err_cmdAddNewSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,


acMenuVer70
Exit_cmdAddNewSave_Click:
Exit Sub

Err_cmdAddNewSave_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewSave_Click

End Sub



Nov 12 '05 #3
Larry

Thanks for your assitance I have now resolved the problem as your
question triggered the answer, when i created the forms using the
multiple table i omited using the id field from the secondary tables.
only using the fields I wanted in the form. Consequently there was no
link to the control IDs. I deleted the form and redisgned it by dropping
all the fields from the 5 tables and then deleted the the fields i didnt
want visible. This has now solved the problem
Thanks and regards
Louis

Larry Linson wrote:
I don't see any foreign key fields to relate the tables. I'd guess that
tbStock, or a Query including it, is RecordSource for the Form, and, perhaps
we can assume that unitcost, sellprice, and qty are Control Source for Text
Boxes, but for the Combos it appears you are indicating RowSource, not
Control Source. If you could clarify, it'd help someone to help you.

Larry Linson
Microsoft Access MVP

"LouD" <du******@yahoo.com> wrote in message
news:WC********************@news-server.bigpond.net.au...
I have 5 tables in my db and when i bring up the linked form I get my
product lists

Tbls are tbStock, which contain unitcost, sellprice n qty
tblProduct, contains ID, medicalname n genericname
tblCat contains ID, catname and catcode
tblPacket which ID, contains packetcode and description
tblSize which ID, contains the size code and description

the form has the StockID(hidden), catname(combo), medicalname,
genricname, packdescription(combo), unicost, sellprice n qty

2 buttons add and save record.

when the form opens i can see all the dat in my tables.

when add button is clicked the table emties and i can key in new details
but i cant write to the cost,sell n qty fiels dont allow me to key in
the detail, and when i click the save button the all other info is
created as new records in the all tables but the price and qty info is


not.
Following is the code that the wizard wrote:

Option Compare Database

Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click
DoCmd.GoToRecord , , acNewRec

Exit_cmdAddRecord_Click:

Exit Sub

Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click

End Sub
Private Sub cmdAddNewSave_Click()
On Error GoTo Err_cmdAddNewSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,


acMenuVer70
Exit_cmdAddNewSave_Click:
Exit Sub

Err_cmdAddNewSave_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewSave_Click

End Sub



Nov 12 '05 #4

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

Similar topics

1
by: Marius Kaizerman | last post by:
Hi, I'm working with access and sql server. I have two tables. Fields in table #1: barcode (unique),transfer_to,quantity_of_items,supplier,price,date_of_shipment Fields in table #2: barcode...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
2
by: Jim | last post by:
In my Win App, I have a datagrid that's bound to a dataset. When the form loads, the datagrid fills. How can I add an empty row to the end of the datagrid during a button click (similar to...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
9
by: Greg | last post by:
Binding Manager & dataset - won't add record I've got an untyped dataset with controls bound through code. The user can select a question number from a bound combobox, and the question number and...
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
8
by: shumaker | last post by:
I'm wondering if adding an autonumber primary key will improve the performance of a multiuser access database on a network share. I have a website that lists many tips for improving performance of...
3
by: benkollam | last post by:
Hi, I have problem updating the changes in the dataset to the database. I am using an Access database and following is the code used for adding a new row. Please help Private Sub...
19
by: emanning | last post by:
Using Access 2003 and using a form that's mostly bound. I need a way to tell if user-1 is on the record when user-2 tries to open the same record, w/o waiting for the user-1 to save the record...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.