G
Guest
Bl**dy new users
HI all, thanks for all help in the past. I will try to explain as follows
I have a main form, MAIN_DATA_ENTRY
There is a second page to the form which carries a subform, I also have
Tbl_Main_Data and the sub form is linked through a query to Tbl_Dev_Plan
linked by unique key fields with update referential integrity.
The main form generates a record which is demonstrated on its table which
has a + against it showing the is a related sub form/table record is present.
However, all fields are null. My Second Page subform generates a bar graph
based on the contents of a bound record source on the same form. In order to
show real time, the bar graph, the form runs Macros (I intend to re-write the
macros in VBA when I am more proficient) on open to calculate the length of
the bar.
Everthing works well if there is data in any of the fields in the sub_table
but everything throws and error if all fields are null.
Question, can I force one of the sub_table fields on which the calculations
are performed to 0 (Zero) Value?
I can do this mechanicall by typing a record to a field in the sub form at
which point there is a record generated and everything caculates without
error.
My Table would be [Tbl_Dev_Plan] and the field would be [Prog_1)
I cant seem to get the syntax right to add a record to the unbound subtable
from the front form using VBA, I can change all existing record values to a
new value so I am missing how to force a new record to be added. I have tried
the following code
DoCmd.RunSQL "UPDATE Tbl_Dev_Plan Set
Tbl_Dev_Plan.Prog_1='[Tbl_Dev_Plan],[Prog_1]+1'=0"
'[Tbl_Dev_Plan].[Prog_1]+1= "
Which of course updates all the existing values
Can anyone help please?
HI all, thanks for all help in the past. I will try to explain as follows
I have a main form, MAIN_DATA_ENTRY
There is a second page to the form which carries a subform, I also have
Tbl_Main_Data and the sub form is linked through a query to Tbl_Dev_Plan
linked by unique key fields with update referential integrity.
The main form generates a record which is demonstrated on its table which
has a + against it showing the is a related sub form/table record is present.
However, all fields are null. My Second Page subform generates a bar graph
based on the contents of a bound record source on the same form. In order to
show real time, the bar graph, the form runs Macros (I intend to re-write the
macros in VBA when I am more proficient) on open to calculate the length of
the bar.
Everthing works well if there is data in any of the fields in the sub_table
but everything throws and error if all fields are null.
Question, can I force one of the sub_table fields on which the calculations
are performed to 0 (Zero) Value?
I can do this mechanicall by typing a record to a field in the sub form at
which point there is a record generated and everything caculates without
error.
My Table would be [Tbl_Dev_Plan] and the field would be [Prog_1)
I cant seem to get the syntax right to add a record to the unbound subtable
from the front form using VBA, I can change all existing record values to a
new value so I am missing how to force a new record to be added. I have tried
the following code
DoCmd.RunSQL "UPDATE Tbl_Dev_Plan Set
Tbl_Dev_Plan.Prog_1='[Tbl_Dev_Plan],[Prog_1]+1'=0"
'[Tbl_Dev_Plan].[Prog_1]+1= "
Which of course updates all the existing values
Can anyone help please?