Query to auto populate another field in same record

CLCoop

New Member
Joined
May 30, 2018
Messages
34
Form called Input Allotments that shows the current funds of one state.
Subform that shows all that states transactions: master_data_auto_fiscal_year_subform based on a Query.
Query: Master_Data_auto_fiscal_year it has all the fields from the MasterData table
The query takes the date entered and breaks it down to Monthnum field, then a field called: FY: IIf([monthnum]<10,Year([DATE]),Year([DATE])+1) this gives me the fiscal year in field FY.

How do you get FY to auto populate FiscalYear field?
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,177
Office Version
365
Platform
Windows
Last edited:

CLCoop

New Member
Joined
May 30, 2018
Messages
34
FieldMonthnum: Month ([Date])FY: IIf([monthnum]<10,Year([DATE]),Year([DATE])+1)DateFiscalYearREVISED_ALLOTMENTS
TableMaster_DataMaster_DataMaster_Data
SortYESYesYes
Show
Criteria[CURRENT_ALLOTMENT]+[GS_INCREASE]-[GS_DECREASE]+[SB_INCREASE]-[SB_DECREASE]+[LEASING_INCREASE]-[LEASING_DECREASE]
or:[FY]

<tbody>
</tbody>

Nothing happens but asks me what I want FY to be when you run the query.
 
Last edited:

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,177
Office Version
365
Platform
Windows
You have to have a field pre set-up in your table to hold this value to hold this value (FY).
Then in your Update Query, you would place the calculation on the "Update To" line of this FY field.
If you look closely at the link I showed you, it shows you some examples and some example calculations.

You probably will also want to add criteria under this FY field to only update records where this field is empty (Is Null), so if you run this query multiple times, you are only updating new records that have a blank in this field.
 

CLCoop

New Member
Joined
May 30, 2018
Messages
34
Ok I was able to update records based on Parent Child just had to manually type in each field I wanted to do. As well as there is a limit to how many parent/child relationships but it was enough to "auto fill" what I was looking for.

Go to the form, edit mode, click on the sub form you are wanting to auto fill based on form. go to Data. See the Link Master Fields and Link Child Fields. When you select this you get three boxes to link up. You can however add more fields by putting a ; with now spaces after the last field listed and keep adding. Remember to add the same to both Parent and Child if you skip one you may have data in the wrong field.
 

Forum statistics

Threads
1,078,504
Messages
5,340,775
Members
399,395
Latest member
KJAC

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top