nepotist
04-02-2009, 12:11 PM
Hello all I need some help here.
I have add new project form and update project form.( and both these forms have a sub form that is table 2)
the main form is based on table 1 which provides all the project information.
well my update form works fine as I provide the user to select a project from a drop down list and run a query and relate it to the form.
In the add new project form the user types in year and number and based on some mathematical calculation the ID is obtained and is and should always be unique.
IN the table one we can have unique number for each year like year 2008 can have 1-500 numbers(no number repeates twice) but they can repeate again for yr 2009 .
in the add new form i want a default value of the number text box to be next available number for that year
i Tried
default value = Dmax(Dlookup("Number","Projects","Year"=frmNew!Year.value)) but that dosent work.
Table 1 looks like this
Year Number ID
2008 1 2008001
2008 2 2008002
2009 1 2009001
I want the default value for the txtbox to be 2 when the year is 2009
I have add new project form and update project form.( and both these forms have a sub form that is table 2)
the main form is based on table 1 which provides all the project information.
well my update form works fine as I provide the user to select a project from a drop down list and run a query and relate it to the form.
In the add new project form the user types in year and number and based on some mathematical calculation the ID is obtained and is and should always be unique.
IN the table one we can have unique number for each year like year 2008 can have 1-500 numbers(no number repeates twice) but they can repeate again for yr 2009 .
in the add new form i want a default value of the number text box to be next available number for that year
i Tried
default value = Dmax(Dlookup("Number","Projects","Year"=frmNew!Year.value)) but that dosent work.
Table 1 looks like this
Year Number ID
2008 1 2008001
2008 2 2008002
2009 1 2009001
I want the default value for the txtbox to be 2 when the year is 2009