473,695 Members | 2,775 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 2084
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
2035
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
2290
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
10240
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
3675
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
6899
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
3070
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
2557
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
9692
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
9240
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
8647
marktang
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9129
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, 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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9004
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
8835
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...
1
6504
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5842
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2285
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1986
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.