473,666 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subform looking for other data tables to write the record...

kcdoell
230 New Member
Hello:

I have four tables:

tblDivision
tblWorking_Regi on
tblCredit_Regio n
tblForecast (This is the main data entry table for all forecasting records)

tblDivision has the following fields:

DivisionID > AutoNumber > Number automatically assigned to new division
DivisionName > Text > Name of the Division

tblWorking_Regi on has the following fields:

WrkRegID > AutoNumber> Number automatically assigned to new working region
WrkRegionName > Text > Name of the Working Region

tblCredit_Regio n has the following fields:
CreditRegID > AutoNumber> Number automatically assigned to new credit region.
CreditRegion > Text > Name of the credit region

tblForecast has the following fields:

ForcastinputID > AutoNumber> Number automatically assigned to new forecasting record
Product > Text
NWP > Currency
GWP > Currency
Other data entry fields for the end user…..
DivisionID > Number > Same as DivisionID in tblDivision table.
WrkRegID > Number > Same as WrkRegID in tblWorking_Regi on table.
CreditRegID > Number > Same as CreditRegID in tblCredit_Regio n table.


A Division can have multiple working regions. A working region can have multiple credit regions and a Credit region can have multiple forecasting records. So what I did was create one to many relationships between the Forecasting table and the other tables. This worked fine but now I am having a problem with my data entry screen. Via another form I have the user select the Division, Working Region and Credit Region then click on a command button which brings them to my “Dataentry forecasting”for m. My Dataentry forecasting form has a subform that is tied to the forecasting table. My problem is that every time I try to input a record the forecast table is asking me for the Division & Working region. It does not ask me for the Credit Region because the wizard somehow tied it to the forecasting table. I understand why it is asking for the Division and Working region but I want to create a dataentry form in which the user does not have to continually indicate The Division and the Working region. Ultimately I would like the form to be dynamic so that the enduser could pick any combination, on the dataentry screen itself, and view, edit add to the forecasting records as needed.

Does anybody have any ideas? I have looked on the help menu and an Access 2003 book I have but can not find what I am specifically trying to accomplish.

Any help would be greatly appreciated.

Thanks,

Keith.
Feb 4 '08 #1
2 2074
Lysander
344 Recognized Expert Contributor
Hello:

I have four tables:

tblDivision
tblWorking_Regi on
tblCredit_Regio n
tblForecast (This is the main data entry table for all forecasting records)

tblDivision has the following fields:

DivisionID > AutoNumber > Number automatically assigned to new division
DivisionName > Text > Name of the Division

tblWorking_Regi on has the following fields:

WrkRegID > AutoNumber> Number automatically assigned to new working region
WrkRegionName > Text > Name of the Working Region

tblCredit_Regio n has the following fields:
CreditRegID > AutoNumber> Number automatically assigned to new credit region.
CreditRegion > Text > Name of the credit region

tblForecast has the following fields:

ForcastinputID > AutoNumber> Number automatically assigned to new forecasting record
Product > Text
NWP > Currency
GWP > Currency
Other data entry fields for the end user…..
DivisionID > Number > Same as DivisionID in tblDivision table.
WrkRegID > Number > Same as WrkRegID in tblWorking_Regi on table.
CreditRegID > Number > Same as CreditRegID in tblCredit_Regio n table.


A Division can have multiple working regions. A working region can have multiple credit regions and a Credit region can have multiple forecasting records. So what I did was create one to many relationships between the Forecasting table and the other tables. This worked fine but now I am having a problem with my data entry screen. Via another form I have the user select the Division, Working Region and Credit Region then click on a command button which brings them to my “Dataentry forecasting”for m. My Dataentry forecasting form has a subform that is tied to the forecasting table. My problem is that every time I try to input a record the forecast table is asking me for the Division & Working region. It does not ask me for the Credit Region because the wizard somehow tied it to the forecasting table. I understand why it is asking for the Division and Working region but I want to create a dataentry form in which the user does not have to continually indicate The Division and the Working region. Ultimately I would like the form to be dynamic so that the enduser could pick any combination, on the dataentry screen itself, and view, edit add to the forecasting records as needed.

Does anybody have any ideas? I have looked on the help menu and an Access 2003 book I have but can not find what I am specifically trying to accomplish.

Any help would be greatly appreciated.

Thanks,

Keith.
Assume that your first form is called 'frmSelection' then what you can do is go to the 'before update' event on the sub form and type the following code.
Expand|Select|Wrap|Line Numbers
  1. if me.newrecord then
  2.    DivisionID=forms!frmSelection!DivisionID
  3.    WrkRegID =forms!frmSelection!WrkRegID 
  4.    CreditRegID=forms!frmSelection!CreditRegID
  5. End if
  6.  
This would set the values for new records.

Alternativly, you could have 3 combo boxes in the footer of you main form, cboDivisionSele ct etc and filter the sub form as you change these values, and again use the code above, but without the forms!frmSelect ion, for new records
Feb 5 '08 #2
kcdoell
230 New Member
Hello:

I applied the code adapted to my form and it works great. It has also given me other ideas as well.

Thanks a lot,

:-)

Keith.
Feb 5 '08 #3

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

Similar topics

6
2030
by: Ray | last post by:
I have a main form with a subform. The main form has a combo box which lists all the clients which in turn are displayed in the subform. The subform is bound to the combo box and all work well. however, I would like to be able to add a new client in the subform but this is, of course bound to the combo box. Can anyone tell me if there is a way to enter a new client in the subform with out receiving an error message? TIA - Ray
4
2283
by: CSDunn | last post by:
Hello, I have a combo box (Combo7) that needs to call a function during the After Update event of the combo box. The function resides in an Access 2000 ADP Module called MMAnswerData_code. The following is the code of the function: Public Function SubFormRS(FrmTarget As Object) Forms!frmAD_OpeningForm!FrmTarget.RecordSource = "EXEC dbo.AdSubFormRecSource " & Forms!frmAD_OpeningForm!SubFormFilter
25
10221
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
2
3671
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS (links the previous tables together so not to have a many-to-many relationship -- has the ContactID and ShowID fields). I have a main form with a couple of listboxes which are used for querying the CONTACTS table. The results populate bound fields...
6
6897
by: Vinayak | last post by:
Hi all, I have a many to many relationship that I want to present in a form/subform combination. The tables are Book, Book_Author_Link and Author. The main form is based on the table Book. How do I link a subform showing Author details of the related Authors for a Book? I can create the two forms independently but am not able to link the forms. Can someone help? Thank you,
1
3064
by: planetthoughtful | last post by:
Hi All, I have a mainform with a subform in which I show some task summary data. On the mainform I have a number of unbound controls that reflect values relevant to each task in the subform. The unbound controls are populated in the subform's OnCurrent even from a number of different tables related to the records in tbl_tasks, which is the recordset displayed in the subform.
2
2554
by: whitc26 | last post by:
Let me preface: I'm a novice, and have no programming experience. I have created an access database and have a few tables in it. I have created a form called "clients" This form opens up and has alot of basic client information in it, nothing fancy, no code (other than what access has put in). I have created a second form "newVisit" This form has a subform on it called "client visit subform". The form is just to be used to record...
9
9684
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
3
9235
by: Richnep | last post by:
Hi all, I have tabbed subforms where I need to copy one field value from one subform over to another subform. Although I can run an update query to accomplish this I would like to do it through VBA. sub tables relationships are 1:N with the main table. So the recods display like this in the subform:
0
8356
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
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 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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4198
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2773
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.