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

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

kcdoell
230 100+
Hello:

I have four tables:

tblDivision
tblWorking_Region
tblCredit_Region
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_Region has the following fields:

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

tblCredit_Region 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_Region table.
CreditRegID > Number > Same as CreditRegID in tblCredit_Region 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”form. 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 2053
Lysander
344 Expert 100+
Hello:

I have four tables:

tblDivision
tblWorking_Region
tblCredit_Region
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_Region has the following fields:

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

tblCredit_Region 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_Region table.
CreditRegID > Number > Same as CreditRegID in tblCredit_Region 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”form. 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, cboDivisionSelect etc and filter the sub form as you change these values, and again use the code above, but without the forms!frmSelection, for new records
Feb 5 '08 #2
kcdoell
230 100+
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
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....
4
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...
25
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...
2
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...
6
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...
1
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....
2
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...
9
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...
3
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...
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:
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: 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,...

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.